Open In App
Related Articles

Python | Django Admin Interface

Like Article
Save Article
Report issue

In this article, we delve into the capabilities and advantages of the Django Admin Interface, exploring how its customizable features and streamlined workflows empower developers to effortlessly administer their projects, from data management to user interactions.

Prerequisites: django-introduction-and-installation | django-introduction-set-2-creating-a-project

Django Admin Interface

When you start a project with Django it also provides a default admin interface that can be used to perform create, read, update, and delete operations on the model directly. It reads a set of data that explains and gives information about data from the model, to provide an instant interface where the user can adjust the contents of the application. This is an in-built module designed to execute admin-related work for the user.

Creating a Superuser in Django Project

The Superuser is the one who can access the Django administration panel and can perform CURD operation on the created models which are shown in the admin panel. The admin app(django.contrib.admin) is enabled by default and already added to the INSTALLED_APPS list present in the file.


To access this admin interface on browser write ‘/admin/’ at ‘localhost:8000/admin/’ and it shows the output as given below:

Note: we are assuming that you have deployed your project on local server.


It prompts for login details, if no login id is created before, then a new superuser can be created by using the command given below:

python createsuperuser

Now, access the admin login page after starting the Development Server which can be done by using the command given below.

python runserver

Enter username and password, then hit login .


After logging in successfully, it shows the interface as shown below: .

Django Admin Interface

This is what is called a Django Admin Dashboard where one can add, delete and update data belonging to any registered model.

Reset Django Admin Password

In Django we can reset django admin password but for this this must make sure you already created a superuser already for which we uses `createsuperuser`command . This command allows you to create a new superuser account or update an existing one if you already have one, and after creating the superuser as show in the above article then we can use the `changepassword` command provided with name of the super user with it and it will change the superuserpassword this will reset the django admin password.

Before writing the command make sure that current directory must have file within it and If not Open the terminal and cd (change directory) into the project folder (the directory with the file).

Then run the command:

python changepassword <username>

Replace <username> with the username of the user for whom you want to change the password.

Here’s an example of how you would use the changepassword command in my case the superuser is Abhishek_Shakya so cammad would be like

python changepassword Abhishek_Shakya
Changepassword of the superuser

and by this we can reset or update the superuser password

Register Model in Django Admin

After starting your project in django and creating or resetting your django superuser you can now access the django administrator and through django admin panel you can perform CRUD operations on your models but the model you created in your app only shows in the admin panel when you register them in your `` of the app you created.

after stating the project create an app

python createapp myapp

Now in the myapp folder we have the file in which we create our model and after creating those model we need to register them in the file of the myapp folder after that we makemigrations of the model created.

register model in django-admin

and the after model creation you have to register the model in django by regestering them into file of `myapp` folder

first import your model at the top of the file if the model you are importing is in the same file you can import by

from .models import <>

In this case the model is Faclity_details, so

from .models import Faclity_details

Now we have to register the model in the file so that it can we visible on the admin panel<>

In this case the model is Faclity_details,so
Register model in admin
python makemigrations

after that migrate all the migrations

pyhton migrate

Now the admin page will have the model Faculty_details but make sure the server is up and running.

Django Admin Interface

Now you are all set to go.

Last Updated : 21 Aug, 2023
Like Article
Save Article
Share your thoughts in the comments
Similar Reads