May 2018
Beginner to intermediate
526 pages
11h 57m
English
Let's add your blog models to the administration site. Edit the admin.py file of your blog application and make it look like this:
from django.contrib import adminfrom .models import Postadmin.site.register(Post)
Now, reload the admin site in your browser. You should see your Post model on the admin site, as follows:

That was easy, right? When you register a model in the Django admin site, you get a user-friendly interface generated by introspecting your models that allows you to list, edit, create, and delete objects in a simple way.
Click on the Add link beside Posts to add a new post. You will ...
Read now
Unlock full access