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)
- Monolithic or microservice concept
- Is it possible to serve a static html page at the root of a django project?
- Django password reset. Not sending mail
Source:stackexchange.com