设置url动态参数
view.py
def detail(request, req_id):
return HttpResponse('req_id:%s' % req_id)
url.py
urlpatterns = [
path('<int:req_id>/detail', views.detail, name='detail'),
]
访问
http://0.0.0.0:8080/myapp/11/detail
设置url动态参数
view.py
def detail(request, req_id):
return HttpResponse('req_id:%s' % req_id)
url.py
urlpatterns = [
path('<int:req_id>/detail', views.detail, name='detail'),
]
访问
http://0.0.0.0:8080/myapp/11/detail