Creating the superuser account for Django

If you are building a new Django application, and do not select Yes to create the superuser account after syncing the database for the first time, you will need create the super user account manually.

To do this, run the following command in your application's directory:

python ./manage.py shell

Then enter the following python code:

from django.contrib.auth.create_superuser import createsuperuser
createsuperuser()

For version 1.0 of Django you will need to run the following command instead:

python ./manage.py createsuperuser

You will now be prompted to enter the username, email and password for the new account.

Last updated: 16/02/2009