You can also send both forms to the same URL:
forms in the template:
<form method="post" action="/profile/"> {% for field in firstform %} <div class="mb10"> <div class="fl desc">{{ field.label_tag }}<br /> <div class="fr">{{ field }}{{ field.errors }}</div> <div class="clear"></div> </div> {% endfor %} {% for field in secondform %} <div class="mb10"> <div class="fl desc">{{ field.label_tag }}<br /><</div> <div class="fr">{{ field }}{{ field.errors }}</div> <div class="clear"></div> </div> {% endfor %} <a class="submit fr" href="#""><img src="{{ MEDIA_URL }}img/save.png" /></a> </form>
and just treat them like this:
if request.method == 'POST': firstform = ProfileForm(request.POST, request.FILES, instance=profile) secondform = UserForm(request.POST, instance=request.user)
and then do things with firstform & secondform.
source share