HTML
"<td><h4><a href="/cyphys/{{user_name}}/historybp/{{current_patient_obj.patientID}}/">BP</a></h4></td>"
这里是views.py
@login_required
def historybp(request, patientID):
context = { 'pid':patientID}
return HttpResponse("request for bp history received")
这里是urls.py
url(r'^(?P<name>\w+)/historybp/(?P<patientID>\d+)/$', historybp),
答案 0 :(得分:0)
您的网址正则表达式中有name
,因此您也需要将此参数传递给您的视图。