【发布时间】:2021-03-22 16:34:51
【问题描述】:
我的 view.py 的 page1.html :
def spwords(request, spray_id)
if request.method == 'POST':
value= request.POST["rangeVal"] #### the other argument that i want to pass it to views.py of the second page html ...
form = forms.SpwordsForm(request.POST)
return HttpResponseRedirect(reverse('sp_url', args=[sp_id])) # if POST we go to page2.html on this url
在我的 url.py 中:
url(r'^queries/(.*)$', qviews.sp_queries, name='sp_url')
在我的 Page2.html 的views.py 中:
def sp_queries(request, sp_id):
#### here i want to recupere arguments : sp_id and value
我想将第一页html的views.py的value=request.POST[“rangeVal”]传递给第二页html,即我想在“HttpResponseRedirect(reverse('sp_url ', args=[sp_id]))"。
但我想保留 urls.py 的格式:即只是查询/sp_id
【问题讨论】:
标签: html python-3.x django django-views python-requests-html