Django | how to append form field to the urlconf
Posted
by MMRUser
on Stack Overflow
See other posts from Stack Overflow
or by MMRUser
Published on 2010-04-22T06:41:57Z
Indexed on
2010/04/22
6:43 UTC
Read the original article
Hit count: 238
django
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.
© Stack Overflow or respective owner