Open In App
Related Articles

How to create superuser in Django?

Improve Article
Improve
Save Article
Save
Like Article
Like
 

Django provides us Admin Panel for it’s users. So we need not worry about creating a separate Admin page or providing authentication feature as Django provides us that feature. Before using this feature, you must have migrated your project, otherwise the superuser database will not be created.

How to create superuser in Django?

For creating superuser, first reach the same directory as that of manage.py and run the following command:

python manage.py createsuperuser

Then enter the Username of your choice and press enter.

Username: srishti

Then enter the Email address and press enter.(It can be left blank)

Email address: example@gmail.com

Next, enter the Password in-front of the Password field and press enter.Enter a strong password so as to keep it secure.

Password: ******  

Then again enter the same Password for confirmation.

Password(again): ******

Superuser created successfully if above fields are entered correctly.

Image shown after above steps done 

Now we can login into our Django Admin page by running the command python manage.py runserver . Then, open a Web browser and go to “/admin/” on your local domain – e.g., http://127.0.0.1:8000/admin/ and then enter the same Username and Password.

                                                                                                                                                                                                  

Django admin page

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 05 Sep, 2020
Like Article
Save Article
Previous
Next
Similar Reads
Complete Tutorials