現在、DjangoURLタグでNoReverseMatchエラーが発生しています。Djangoの決定的なガイド、Djangoのドキュメントをフォローし、この辺りとインターネットを検索しました
URL:
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
前もって感謝します