Django admin

Django admin
 
To add, edit and delete posts we've just modeled, we will use Django admin.

Let's open the blog/admin.py file and replace its content with this:

from django.contrib import admin
from .models import Post

admin.site.register(Post)


To make our model visible on the admin page, we need to register the model with admin.site.register(Post).

Go to the browser and type the address http://127.0.0.1:8000/admin/

To log in, you need to create a superuser - a user which has control over everything on the site.

Go back to the command-line and type

 python manage.py createsuperuser


0 comments:

Copyright © 2013 SoftKul