[Solved]-Django admin page doesn't show tables of database (djangobook chapter 06)

34👍

You need to keep reading http://django-book.readthedocs.org/en/latest/chapter06.html#adding-your-models-to-the-admin-site

There’s one crucial part we haven’t done yet…
Within the books directory (mysite/books), create a file called
admin.py, and type in the following lines of code:

from django.contrib import admin
from mysite.books.models import Publisher, Author, Book

admin.site.register(Publisher)
admin.site.register(Author)
admin.site.register(Book)

0👍

You have to register your model in the admin.py file which is inside your app directory.

If there is not admin.py you have to create one and then register it.

In my case I have a Registeration model I have created admin.py file inside the app directory and I added the following code.

from django.contrib import admin

from .models import Registeration

admin.site.register(Registeration)

Leave a comment