我多次看过这个问题,但没有人回答我的问题 我添加了一个应用程序及其模型,但在管理门户中看不到它们 我可以从shell访问该模型。
settings.py
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
'myApp',
)
urls.py
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'RCOSPortal.views.home', name='home'),
# url(r'^RCOSPortal/', include('RCOSPortal.foo.urls')),
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),
)
admin.py
from django.contrib import admin
from myApp.models import Owner
admin.site.register(Owner)
答案 0 :(得分:1)