DEV Community

Dr. Azad Rasul
Dr. Azad Rasul

Posted on

8- Django: introducing admin

To create an admin user, run the following command:

py manage.py createsuperuser
Enter fullscreen mode Exit fullscreen mode

Enter any username, for example Azad and press enter.
Then enter your email address, for example: azad977@gmail.com
Then create a password.
You should see:

Superuser created successfully.
Enter fullscreen mode Exit fullscreen mode

Now, open a web browser and go to http://127.0.0.1:8000/admin/. You should see the admin’s login screen.
Try logging in with the superuser account you created in the previous step.

To display poll app on the admin index page, open the polls/admin.py file, and edit it to look like this:

from django.contrib import admin

from .models import Question

admin.site.register(Question)
Enter fullscreen mode Exit fullscreen mode

If you like the content, please SUBSCRIBE to my channel for the future content

Top comments (0)