0PricingLogin
Django Academy · Lesson

Customizing ModelAdmin

Set list_display, list_filter, and search_fields.

Beyond the Defaults

The default admin works but feels plain. A ModelAdmin class lets you reshape how each model looks and behaves in the admin.

Subclass and Attach

Create a class that subclasses admin.ModelAdmin, then pass it when you register the model. That class holds all your tweaks.

class PostAdmin(admin.ModelAdmin):
    pass
admin.site.register(Post, PostAdmin)

All lessons in this course

  1. createsuperuser and Logging In
  2. Registering Models with admin.site
  3. Customizing ModelAdmin
  4. Inlines and Readonly Fields
← Back to Django Academy