0
我有一個應用程序,我想成爲網站的根。所以,我包括在我的主urls.py以下URLPATTERN像這樣:無法讓URL配置工作
(r'^$', include('search.urls')),
在我的搜索urls.py
,我把它以下列方式設置:
urlpatterns = patterns('search.views',
(r'^$', 'index'),
(r'^results/$', 'results'),
)
URLPATTERN作品指標,它進入索引視圖,但結果urlpattern不起作用。我收到以下錯誤,當我嘗試訪問結果:
Using the URLconf defined in textbook.urls, Django tried these URL patterns, in this order: 1. ^books/ 2. ^$ 3. ^admin/ 4. ^static/(?P.*)$ The current URL, results/, didn't match any of these.
編輯: 主要urls.py
:
urlpatterns = patterns('',
(r'^books/', include('books.urls')),
(r'^$', include('search.urls')),
(r'^admin/', include(admin.site.urls)),
(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
)
請顯示您的主要urls.py的其餘部分。 – 2011-03-21 07:45:01