1👍
What if you change the names of your form variable in the return
statement i.e.
{'formRegister':form}
and the other one:
{'formLogin':form}
UPDATE:
In your url file, you could do the following:
url(r'^access/login/$','users.views.login_user'),
url(r'^access/register/$','users.views.register_user'),
The same template will still be used, but with different views to handle the forms.
Other alternatives include:
-
Putting different URLs in the action attribute of the two forms. Then you will have two different view functions to deal with the two different forms.
-
Reading the values of submit buttons from the POST data. You can tell which submit button was clicked, then handle the logic.
Source:stackexchange.com