Django Fundamentals
Register Models in AdminEasyWrite Code
4/10
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

01Register `Post` with a custom `ModelAdmin`
02Set `list_display` to show title, author, created_at
03Add `list_filter` for created_at and author
04Add `search_fields` for title and body
Python 3
1
2
3
4
5
6
Ln 6, Col 1