我试图用Django 1.4在Windows 7上与默认的Web服务器。 该网站以无错误开头。但是当我浏览到本地主机:8000 我收到以下错误Django注册 - 错误没有模块命名的网址
ImportError at/
No module named urls
我看到那里的错误来自
它是在主URLs.py文件 - (R“^管理员/”,包括('django.contrib.admin.urls')),
如果我删除该表单的URLs.py文件的主页出现。我在“C:\ Python27 \ Lib \ site-packages \ django \ contrib \ admin”文件夹中看不到urls.py文件。所以,这个错误是有道理的。
但是该行必须在那里才能使Django注册包工作。我读过的所有博客都有这一行。我如何获得通过这个?非常感谢您的错误。
修复了以下Siva的说明中的url.py。但没有运气。
from django.conf.urls import patterns, include, url
from SOWLAPP.views import *
from CATALOG.views import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'SOWL.views.home', name='home'),
# url(r'^SOWL/', include('SOWL.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'^user/(\w+)/$', user_page),
(r'^login/$', 'django.contrib.auth.views.login'),
(r'^catalog/$', home),
(r'^static/(?P<path>.*)$', 'django.views.static.serve',
{ 'document_root' : 'C:/SHIYAM/Personal/SuccessOwl/SOWL0.1/SOWL/SOWL/static'}),
(r'^admin/', include('django.contrib.admin.urls')),
(r'^accounts/', include('registration.urls')),
(r'^$', main_page),
)
问候, SHM
settings.py中ROOT_URLCONF变量的值是多少? – 2012-08-15 18:45:40