Django を使い始めて、URL ディスパッチャを見つけました。ドキュメントでわかることから、次の正規表現はキャッチする必要がありますnews/story/2012/10/23/this-is-my-first-story
urlpatterns = patterns('news.views',
url(r'^$', 'index'),
url(r'^news/story/(?P<year>\d{4})/(?P<month>\d){2}/(?P<day>\d){2}/(?P<title_key>\w+)/$', 'story'),
)
ただし、次のエラーが表示されます...
で定義されている URLconf を使用して
mysite.urls
、Django は次の URL パターンを次の順序で試しました。
^polls/
^news/
^$
^news/
^news/story/(?P<year>\d)/(?P<month>\d)/(?P<day>\d)/(?P<title_key>\d)/$
^admin/doc/
^admin/
現在の URL は
news/story/2012/10/23/this-is-my-first-story
、これらのいずれとも一致しませんでした。