2

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?

4

1 回答 1

3

@i.h4d35 我认为 DivinusVox 是对的。尝试在 settings.py 的 INSTALLED_APPS 中添加您的新应用程序,它应该可以解决。请从Django 官方网站查看管理员信息。

于 2013-08-30T05:25:14.200 回答