有人可以解释下吗:
# urls.py
from django.conf.urls.defaults import *
from mysite import views
urlpatterns = patterns('',
(r'^blog/$', views.page),
(r'^blog/page(?P<num>\d+)/$', views.page),
)
# views.py
def page(request, num='1'):
# Output the appropriate page of blog entries, according to num.
# ...
那个urlconf中page(?P<num>\d+)这个page是否多余,如果不多余该怎么理解?
文章原文地址:
http://djangobook.py3k.cn/2.0/chapter08/