【发布时间】:2012-10-31 14:17:58
【问题描述】:
当我尝试访问我的 Django 管理站点时,出现以下错误:
/admin/ 处的 ImportError
没有名为 django.views 的模块
请求方法:GET 请求地址:
http://127.0.0.1:8000/admin/Django 版本:1.4.1 异常类型:ImportError 异常值:没有名为 django.views 的模块
异常位置: /usr/local/lib/python2.7/dist-packages/django/utils/importlib.py 在 import_module,第 35 行 Python 可执行文件:/usr/bin/python Python 版本:2.7.3
这是我的 urls.py 文件:
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', include('home.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)),
)
当我评论url(r'^$', include('home.urls')) 行时,管理站点再次运行。
我无法弄清楚我的问题是什么。你能帮帮我吗?
【问题讨论】:
标签: python django django-admin