Create your administration models

  1. Create your models
  2. Beyond the SQL
  3. Public pages

http://docs.djangoproject.com/en/dev/ref/contrib/admin/

Django’s administration page will let us create posts, authors, and topics. But we need to tell the admin page about our new app.

Create a new file in the “postings” directory, and call it “admin.py”.

from django.contrib import admin

from Blog.postings.models import Post, Author, Topic

admin.site.register(Post)

admin.site.register(Author)

admin.site.register(Topic)

You’ll need to cancel the runserver (CTRL-C) and restart it to get Django to recognize that there’s a new file in the postings directory. But once you do, you can go to http://localhost:8000/admin/postings/ to edit your posts, authors, and topics.

Now that you’ve got a model and an administration screen, go ahead and add H. L. Mencken’s “War” essay and George Orwell’s “Atomic Bomb” essay.

  1. Create your models
  2. Beyond the SQL
  3. Public pages