Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags


How to create a superuser in Django

Abdul Monim Tariq Lodhi


We do not create a separate “Admin” page or provide an authentication feature because Django provides an “Admin” panel for its users. Furthermore, we must migrate to our project before using this feature; otherwise, we will not be able to create a database of superusers.

Simple steps to follow

We can create a superuser by writing the following command:

python3 createsuperuser

We then write the following credentials step by step. We can fill these credentials according to our preferences:

  • Username: testAdminUser

  • Email address:

  • Password: ********

  • Password (again): ********

Note: After filling a row, press “Enter” to fill the other information.

Now the superuser will be created if we have entered all fields correctly.

Creation of superuser
Creation of superuser

Django’s “Hello World” application

A sample “Hello World” Django application is given below. We can follow the given steps to test our knowledge:

  • Start the terminal by clicking on the “Run” button.
  • Type python3 createsuperuser in the given terminal and press “Enter”.
  • The system will ask for credentials, after which a superuser will be created.
  • To run the server, we type the command python3 runserver and press “Enter”.
from django.db import models

# Create your models here.
  • Now we can find our application by clicking on the link below the “Run” button.

  • To see the login page for the Django “Admin” site, we need to append /admin/ at the end of our base URL. For example, if the application is running at, we can access the admin panel at

Django "Admin" login page
Django "Admin" login page
  • Now we can type our username and password, then press the “Log in” button.




Abdul Monim Tariq Lodhi
Copyright ©2022 Educative, Inc. All rights reserved

View all Courses

Keep Exploring