有一种方法是: http://catherinetenajeros.blogspot.jp/2013/03/how-to-handle-multiple-forms-in-one-view.html
Sometimes we make two forms or more in one page which result to unnecessary output or error. To handle this problem, we have to put unique value in each form.
#page.html
<form method="POST">
{{form1.as_p}}
<input type="hidden" name="action" value="first">
<input type="submit" value="Submit">
</form>
<form method="POST">
{{form2.as_p}}
<input type="hidden" name="action" value="second">
<input type="submit" value="Submit">
</form>
<form method="POST">
{{form3.as_p}}
<input type="hidden" name="action" value="third">
<input type="submit" value="Submit">
</form>
Notice that in every form I put <input type="hidden" name="action"> which has different value (first, second, third). This hidden value will be use in views.
#views.py
def myview(request):
if request.method == 'POST':
if request.POST['action'] == 'first':
//do stuff here for form1
elif request.POST['action'] == 'second':
//do stuff here for form2
elif request.POST['action'] == 'third':
//do stuff here for form3
return render(request, 'mypage.html')
In this way the system will know which form must be process.
This is only a basic sample. There are many ways to handle this kind of problem.