Django | how to append form field to the urlconf
- by MMRUser
I want to pass a form's field value to the next page (template) after user submit the page, the field could be user name, consider the following setup
def form_submit(request):
if request.method == 'POST':
form = UsersForm(request.POST)
if form.is_valid():
cd = form.cleaned_data
try:
newUser = form.save()
return HttpResponseRedirect('/mysite/nextpage/')
except Exception, ex:
return HttpResponse("Ane apoi %s" % str(ex))
else:
return HttpResponse('Error')
"nextpage" is the template that renders after user submit the form, so I want to know how to append the form's field (user name) to the url and get that value from the view in order to pass it to the next page..
thanks.