当url如:时
domain/search/?q=haha,你将使用
request.GET.get('q', '')。q是你想要的参数,并且
''是默认值(如果
q未找到)。
但是,如果你只是配置
URLconf,则你从中捕获的内容
regex将作为参数(或命名参数)传递给函数。
如:
(r'^user/(?P<username>w{0,50})/$', views.profile_page,),然后在你views.py中
def profile_page(request, username): # Rest of the method



