紫衣仙女
最简单的形式from django.conf.urls import patterns, urlurlpatterns = patterns('',url(r'^articles/2003/$', 'news.views.special_case_2003'),url(r'^articles/(\d{4})/$', 'news.views.year_archive'),url(r'^articles/(\d{4})/(\d{2})/$', 'news.views.month_archive'),url(r'^articles/(\d{4})/(\d{2})/(\d+)/$', 'news.views.article_detail'),)其中,正则表达式中组匹配出来的结果可以作为positional parameters传递给view.