Codetail
Dashboard
Problems
Paths
Sessions
AC
Django Fundamentals
Register Models in Admin
Easy
Write Code
Prev
4/10
Next
admin.site.register
Description
Register the `Post` model in Django's admin interface with a customized display showing the title, author, and creation date in the list view.
Requirements
01
Register `Post` with a custom `ModelAdmin`
02
Set `list_display` to show title, author, created_at
03
Add `list_filter` for created_at and author
04
Add `search_fields` for title and body
Show 2 hints
Python 3
1
2
3
4
5
6
from django.contrib import admin from .models import Post # Register your model with a custom admin class
Ln 6, Col 1
Submit for Review