Debug School

rakesh kumar
rakesh kumar

Posted on

Django Admin Interface

Refer here
Refer here
Refer heres
Refer here

Starting the Admin Interface
The Admin interface depends on the django.countrib module. To have it working you need to make sure some modules are imported in the INSTALLED_APPS and MIDDLEWARE_CLASSES tuples of the myproject/ file.

For INSTALLED_APPS make sure you have −


Enter fullscreen mode Exit fullscreen mode

Django provides a built-in admin module which can be used to perform CRUD operations on the models. It reads metadata from the model to provide a quick interface where the user can manage the content of the application.

This is a built-in module and designed to perform admin related tasks to the user.

Let's see how to activate and use Django's admin module (interface).

The admin app (django.contrib.admin) is enabled by default and already added into INSTALLED_APPS section of the settings file.

To access it at browser use '/admin/' at a local machine like localhost:8000/admin/ and it shows the following output:

Image description

It prompts for login credentials if no password is created yet, use the following command to create a user.

Create an Admin User

$ python3 createsuperuser 
Enter fullscreen mode Exit fullscreen mode

Image description

Now start development server and access admin login.

$ python3 runserver 
Enter fullscreen mode Exit fullscreen mode

Provide created username and password and login.

Image description

Image description

Top comments (0)