Django Tutorial
About Lesson

In this Django Tutorial we are going to talk about Django Super User, so it is one of the most powerful features that Django has automatic admin interface, It can reads metadata from your models to provide a quick, model-centric interface where trusted users can manage content on your site.

 

Now first of all you need to create a super user in django, you can use this command for creating django super user.

 

 

After that it will asks you for username, email and password.

Django Tutorial - Django Super User
Django Tutorial – Django Super User

 

 

 

Now got to http://localhost:8000/admin/, give your username and password and now we have our admin site.

Django Admin Site
Django Admin Site

 

 

 

All right guys now we want to add our django model to our admin site, there are two ways that you can register your django models in the admin site, first of all open your admin.py file and add this code. 

 

Now if you check your Django Admin Site you will see your model in their and you can simply do CRUD operations using you django admin panel.

 

 

In the second way you can customize your django admin site,  in this way first we register our model using register decorator, after that we create a class that extends from ModelAdmin and at the end you can add your filters.

 

 

 

 

Now if you check your admin site, you will have a customized admin panel.

Django Customized Admin Site
Django Customized Admin Site