The Django admin interface can be customized to improve the user experience. You can modify how models are displayed, enable search functionality, add filters, and customize the layout of list views.
list_display – Controls visible columnssearch_fields – Enables admin searchlist_filter – Adds sidebar filtersordering – Default record sortingDjango provides the ModelAdmin class to customize how models appear in the admin panel. You extend this class and configure options to control display, search, and filtering behavior.
# Custom admin configuration for Product model
from django.contrib import admin
from .models import Product
class ProductAdmin(admin.ModelAdmin):
list_display = ('name', 'price', 'stock', 'created_at')
admin.site.register(Product, ProductAdmin)
# Enable search by name and description
class ProductAdmin(admin.ModelAdmin):
search_fields = ('name', 'description')
# Add sidebar filters in admin list view
class ProductAdmin(admin.ModelAdmin):
list_filter = ('category', 'price')
# Sort products by newest first
class ProductAdmin(admin.ModelAdmin):
ordering = ('-created_at',)
After applying these configurations, the Django admin panel will show structured columns, search input, filter sidebar, and ordered records—making data management faster and cleaner.
Try the simulator below. Use the Search box, click the Column Headers to sort, or use the Sidebar to filter by category.
| Product Name ↕ | Price ↕ | Status ↕ |
|---|
list_display for claritylist_display