我的views.py 文件中有这个方法,它打印从方法rangeOfList() 返回的列表。
我想在将浏览器重定向到(result.html)的html页面上显示它。我该怎么写?
def contact(request):
if request.method == 'POST': # If the form has been submitted...
form = ContactForm(request.POST) # A form bound to the POST data
if form.is_valid():
form = form.cleaned_data
parameters = organize(form)
listToPrint = rangeOfList(parameters['money'][2], parameters['money'][4], 'total_money')
return HttpResponseRedirect('result') # Redirect after POST
else:
form = ContactForm() # An unbound form
return render(request, 'crunchApp/contact.html', {
'form': form,
})