我已经多次看到这个问题,但没有人回答我的问题。
我添加了一个应用程序及其模型,但在管理门户中看不到它们。
我可以从 shell 访问模型。
设置.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',
)
网址.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)),
)
管理员.py
from django.contrib import admin
from myApp.models import Owner
admin.site.register(Owner)