Administering your Django website

Overview

The admin site

The site is just another app. you can use the built-in administration app by adding it to your settings.py file. By default it’s already added.

The code

open the blog’s admin.py file in a text editor:

nano script_builder/admin.py
from django.contrib import admin
from .models import Author, Genre, Book, BookInstance

admin.site.register(Book)
admin.site.register(Author)
admin.site.register(Genre)
admin.site.register(BookInstance)
python manage.py createsuperuser
python3 manage.py runserver

Go to localhost:8000/admin

External Resources