Create your administration models: Customizing the admin

  1. Create your administration models
  2. Filters

A couple of things immediately come to mind. First, the slug will almost always be very similar to the title. Second, while the list of posts is perfectly serviceable, it could be a lot more useful. When we have a hundred or a thousand posts, it’ll be nice if we can see the date, author, and other items in the list of posts.

We can customize the administration screen by subclassing the basic ModelAdmin class and replacing the registration of Post:

class PostAdmin(admin.ModelAdmin):

list_display = ['title', 'author', 'date', 'live']

admin.site.register(Post, PostAdmin)

Notice that the column headers are now links: click on them to change the sorting.

  1. Create your administration models
  2. Filters