How to create search field in django admin

Hello World, Welcome to Today we will discuss how to create a search field in the Django admin panel. I am using Django 3. Django is a very powerful MVT (Model View Template) web Framework built with python. It comes with lots of features.

For creating a search option in the Django admin panel, We just need to activate the search features. If you have not created an admin panel in Django then please have a look at the following tutorial ?.

How to create an admin panel in Django 3

Activate the search feature in the admin panel

  • Please openĀ your_app/
  • Suppose you have created a Video ModelĀ and you want to make video title searchable in the admin panel.
  • Create the following class before register your Video Model in the admin.
class VideoAdminModel(admin.ModelAdmin):
  • Register Video Model with this class.

After applying these changes, you will see the search option above the videos list like following.


Leave a Reply

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