Created
October 16, 2019 06:15
-
-
Save jvorcak/395e8705bf0031fe9a43669bc1d15aeb to your computer and use it in GitHub Desktop.
Submitting multiple forms in Django
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form action="" method="post"> | |
{% csrf_token %} | |
{{ form.as_ul }} | |
<button type="submit" name="form_1">Submit</button> | |
</form> | |
<form action="" method="post"> | |
{% csrf_token %} | |
{{ form.as_ul }} | |
<button type="submit" name="form_2">Submit</button> | |
</form> | |
views.py | |
'form_1' in request.POST | |
'form_2' in request.POST | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment