我有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