I have a Django project that has 2 apps - a blog app and a tutorials app. I just completed the blog app and it has the admin.py
for registering the models like so:
admin.site.register(Blog, BlogAdmin)
admin.site.register(Category, CategoryAdmin)
I just started working on the tutorials app and wrote the models and created the admin.py
within it. It looks as follows:
admin.site.register(Tutorial, tutorialAdmin)
admin.site.register(tutType, tutTypeAdmin)
The models have been imported. However, when I run python manage.py syncdb
and then python manage.py runserver
, I do not find the new models in the admin section of the site (127.0.0.1:8000/admin
).
Should I move the admin.py
outside both the apps and make it a single file which registers all the models of the different apps? Or is there some other step that I am missing out on?