Registering and Configuring
Four lines gets you a working interface for creating, editing, searching and deleting your data. For internal tools and for your own debugging it is genuinely excellent, and it is one of the reasons people choose Django.
The options worth setting immediately.
list_display decides the columns. Without it every row is just __str__.
list_filter puts a sidebar of filters on the right.
search_fields adds a search box, and you choose which columns it looks in.
prepopulated_fields fills the slug in from the title as you type.
Each is one line and each removes a genuine daily annoyance.
✦ The admin is for staff, not for users
It assumes everyone who reaches it is trusted, shows every field of every model, and offers bulk delete on the first screen. It is not a user-facing interface and dressing it up as one ends badly. Build the pages your users need; keep the admin for the people who run the site.
Mark this lesson complete
Signed in, your progress follows you to every device.