How To Access The Django Admin.

The Django administration site is a wonderful feature unique to the web development framework. Itโ€™s one of the Django features that makes it stand out against other web development frameworks like Laravel. The admin allows you to interact with the models you have registered in the file. Django professionals can go away with using the shell to do that, but for a beginner, the admin is easier to use and can save a lot of time. If youโ€™ve been wondering how you can access the Django admin, then this post is for you.

Table of Contents: Access Django Admin

Follow the steps below to access the Django Admin:

  1. Migrate the Built-in Models
  2. Create a Superuser
  3. Run the Django Development Server
  4. Navigate to
  5. Log In using your Superuser Credentials

Below are the steps in detail.

Step 1: Migrate the Built-in Models

Django comes with some apps and models already created for you. One such model is the User model which stores information about various users of your Django project, including the superuser. Before you can create a superuser, you have to migrate these models to the database so that they can start storing information in tables.

To migrate models to the database, run the following command in the terminal of your project:

(env) $ python migrate

The output should be like this:

Step 2: Create a Superuser

In Django, a superuser is a special type of user who has access to the admin panel and has all the permissions available.

To access the Django administration site, you have to create a superuser first. We do that using the superuser command.

In the terminal of your Django project, run the command as follows:

(env) $ python createsuperuser

This command will ask you to provide the username and email for the superuser and then a password that you have to repeat two times. You have to remember this information because you will use it to log in to the admin later.

Password (again):

The email is optional, if you do not want to provide it, just press enter on the email form.

If the superuser gets created, your terminal will print out the message โ€˜Superuser created successfullyโ€™.

Step 3: Run the Django Development Server

Now that the superuser has been created, we can now use its information to log in to the admin. But before we do that, we have to run the Django development server first. It allows us to access our project in real-time from the browser, including the admin site. We do that using the runserver command.

In the terminal of your project, run the command as follows:

(env) $ python runserver

If there are no errors in your project, the server should start running.

Step 4: Navigate to

When the server starts running, open your browser and navigate to This URL is supposed to navigate us to the admin panel, but because we are not logged in to the admin, it will redirect us to the login page. After logging in, you will directly access the admin panel the next time you visit this link (unless you log out).

That login page itself has the URL, which you can also use to navigate to the login page directly.

Step 5: Log In using your Superuser Credentials

Okay, we are now on the adminโ€™s login page, do you still remember the username and password. Good, now type them in the form and click the Log In button. If you forgot your superuser password, check out some ways to reset the superuser password.

Tada! We have successfully accessed the Django admin. Now inside the administration site, you can do a lot of things and one of the most important is performing CRUD operations on your models data.

How To Access The Django Admin.

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top