Thursday, February 28, 2013

Re: How to redirect to same page on failed login

Are you tried Login Redirect ?

2013/2/28 Suneil Rudra <suneil.rudra@gmail.com>
Hi, I'm quite new to using Django, and I've searched around for a while for a solution but haven't really found anything useful.

I'm using a context processor to make my login form available from base.html. When I login in with valid details, it redirects me to the the page I logged in from as expected. However when I enter incorrect credentials it redirects me to /login/. I've tried using HttpResponse Redirect which will redirect me back to the referring page but then my form is empty so it no longer displays the field error messages. I've tried using render_to_response which gives me the field error messages but on /login/ rather than on the original page.

Any help would be much appreciated,
Thanks

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Rafael E. Ferrero
Claro: (03562) 15514856

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment