当前遭受 Django URL 标记的 NoReverseMatch 错误。一直在关注 Django 的权威指南,Django 文档,并在此处和互联网上搜索
网址:
url(r'^test/', Search_Page),
url(r'^search/', Search),
url(r'^details/', Details_Main),
url(r'^Link/(d+)/$', Link),
url(r'^$', 'Parks.views.Link', name="home"),
url(r'^(?P<result_name>)/$', Link),
观点:
def Link(request, result_name):
return render_to_response('Search_Page.html')
模板:
{% for result in results %}
<a href="{% url name result.name %}">test</a>
错误:
NoReverseMatch at /search/
Reverse for 'name' with arguments '(u'North West Thrill Centre',)' and keyword arguments '{}' not found.Request Method: GET
Request URL: http://127.0.0.1:8000/search/?search=a&type=parks&submit=Search
Django Version: 1.4.2
Exception Type: NoReverseMatch
Exception Value: Reverse for 'name' with arguments '(u'North West Thrill Centre',)' and keyword arguments '{}' not found.
Exception Location: C:\Python27\lib\site-packages\django\template\defaulttags.py in render, line 424
Python Executable: C:\Python27\python.exe
Python Version: 2.7.3
Python Path: ['C:\\Users\\User\\Documents\\Django\\ParkManager',
'C:\\Windows\\system32\\python27.zip',
'C:\\Python27\\DLLs',
'C:\\Python27\\lib',
'C:\\Python27\\lib\\plat-win',
'C:\\Python27\\lib\\lib-tk',
'C:\\Python27',
'C:\\Python27\\lib\\site-packages']
Server time: Mon, 4 Feb 2013 16:44:27 +0000
Error during template rendering
In template C:\Users\User\Documents\Django\ParkManager\Templates\Details_Main.html, error at line 23
提前致谢