Django 1.4 NoReverseMatch Found -


urls.py

urlpatterns = patterns('',     url(r'^$', 'entertainment_website.views.index'),     url(r'^story/(?p<news_type>\d+)/(?p<story_id>\d+)', 'entertainment_website.views.story'),     url(r'^admin/doc/', include('django.contrib.admindocs.urls')),     url(r'^admin/', include(admin.site.urls)), ) 

url creation:

<h2 class="main_story_headline"><a href="{% url entertainment_website.views.story story_id=story.id news_type=story.news_type %}">{{ story.title }}</a></h2> 

what doing incorrectly cause following error:

noreversematch @ / reverse 'entertainment_website.views.story' arguments '()' , keyword arguments '{'story_id': 690, 'news_type': u'nightlife'}' not found. 

news_type supposed integer, passed string (unicode) fails.


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -