我試圖用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