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 の作成:
<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>
次のエラーを引き起こすために私が間違っていることは何ですか:
NoReverseMatch at /
Reverse for 'entertainment_website.views.story' with arguments '()' and keyword arguments '{'story_id': 690, 'news_type': u'nightlife'}' not found.