To be able to create and edit different blog posts in our application, the easiest way is to make ourselves a superuser and create those posts via Django's admin interface. Let's walk through that process with the following steps:
- In the manage.py panel, enter the following command:
manage.py@mysite > createsuperuser
- Django will then ask for the login credentials for this superuser. Simply input your information to finalize this process. Next, we have to register our Post model with the admin interface. To do this, go to blog/admin.py and enter the following code:
from django.contrib import adminfrom .models import Post# Register your models here.admin.site.register(Post)
This script basically lets Django know ...