Django Builtin Management Commands


Django comes with a number of builtin management commands, using python [command] or, when has +x (executable) rights simply ./ [command] . The following are some of the most frequently used:

Get a list of all available commands

./ help

Run your Django server on localhost:8000; essential for local testing

./ runserver

Run a python (or ipython if installed) console with the Django settings of your project preloaded (attempting to access parts of your project in a python terminal without doing this will fail).

./ shell

Create a new database migration file based on the changes you have made to your models. See Migrations

./ makemigrations

Apply any unapplied migrations to the current database.

./ migrate

Run your project's test suite. See Unit Testing

./ test

Take all of the static files of your project and puts them in the folder specified in STATIC_ROOT so they can be served in production.

./ collectstatic

Allow to create superuser.

./ createsuperuser

Change the password of a specified user.

./ changepassword username

Full list of available commands