How insert 2 different forms on the same page in Django
Posted
by xRobot
on Stack Overflow
See other posts from Stack Overflow
or by xRobot
Published on 2010-05-03T13:25:22Z
Indexed on
2010/05/03
13:28 UTC
Read the original article
Hit count: 232
django
|django-forms
I have to insert 2 forms in the same page:
1) Registration form
2) Login form
.
So if I use this in the views.py:
if request.method == 'POST':
form = registrationForm(request.POST)
if form.is_valid():
form.save()
return render_to_response('template.html', {
'form': form,
})
I will get error by submitting one of two forms.
How can I distinguish the 2 forms submitting in the views ?
© Stack Overflow or respective owner