Last modified: Jan 10, 2023 By Alexander Williams

How to Create a Django Superuser using Command Line

In this article, we'll learn how to create a Django superuser by using the command line.

creating Django superuser

command:

python 2:


python manage.py createsuperuser
    

python 3:


python3 manage.py createsuperuser

so now, let's create a superuser in a real project.

Remember, before creating your superuser, you need to be in the project core directory.


python3 manage.py createsuperuser
Username (leave blank to use 'py'): pytutorial
Email address: pytutorial@py.com
Password: 
Password (again): 
Superuser created successfully.
    

as you can see, after entering my password and some optional information, the user is created.

now, let's check out if the user is working


How to Create django Superuser using Command Line



How to Create django Superuser using Command Line

Done!