Django Management Commands


Management commands are powerful and flexible scripts that can perform actions on your Django project or the underlying database. In addition to various default commands, it's possible to write your own!

Compared to regular Python scripts, using the management command framework means that some tedious setup work is automatically done for you behind the scenes.


Management commands can be called either from:

  • django-admin <command> [options]
  • python -m django <command> [options]
  • python <command> [options]
  • ./ <command> [options] if has execution permissions (chmod +x

To use management commands with Cron:

*/10 * * * * pythonuser /var/www/dev/env/bin/python /var/www/dev/ <command> [options] > /dev/null