我有Django管理员的一些问题。Django管理员DoesNotExist在/管理员/
执行syncdb后,结果是:
Creating tables ...
Installing custom SQL ...
Installing indexes ...
No fixtures found.
这是什么意思?
无论如何,当我访问的网站管理面板http://www.example.com/admin/,我收到此消息:
DoesNotExist at /admin/
Site matching query does not exist.
setting.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',
)
ur.py包含:
from django.conf.urls.defaults import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'rshd.views.home', name='home'),
# url(r'^rshd/', include('rshd.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)),
)
只需在'urls.py'文件中使用'from django.conf.urls.defaults import *'和'from django.conf import settings'并检查 – 2012-03-16 12:19:33
感谢Harshith JV但是不会改变任何东西 – 2012-03-16 12:27:15
你可以看到syncdb的结果不包含为管理员创建表! – 2012-03-16 12:28:52