how to get back to a view requiring login

2009-10-11 Thread Sergio A.
I've three views each with different URL. They are visible to logged in users. If a non-logged user tries to access a URL requiring login, I'm able to redirect it to the login page. What I'm missing is how to go back to the initial page, once the user log in the system. Cheers, Sergio --~--~---

Re: how to get back to a view requiring login

2009-10-11 Thread Florian Schweikert
2009/10/12 Sergio A. > > I've three views each with different URL. They are visible to logged > in users. > If a non-logged user tries to access a URL requiring login, I'm able > to redirect it to the login page. > > What I'm missing is how to go back to the initial page, once the user > log in t

Re: how to get back to a view requiring login

2009-10-11 Thread Bayuadji
On 10/11/09, Florian Schweikert wrote: > 2009/10/12 Sergio A. > >> >> I've three views each with different URL. They are visible to logged >> in users. >> If a non-logged user tries to access a URL requiring login, I'm able >> to redirect it to the login page. >> >> What I'm missing is how to go

Re: how to get back to a view requiring login

2009-10-12 Thread Rama Vadakattu
Very simple: 1.Once you are in login page you need to store url to which you need to go. How should you do that? protected view === def protected_view(request) : if user is not authenticated : url = request.getpath() # method which actually

Re: how to get back to a view requiring login

2009-10-12 Thread Arthur Metasov
as for me, @login_required decorator redirects to http://localhost/accounts/login/?next=/path/ if you use generic view to display login page it will automatically redirect user to /path/ after login. 2009/10/12 Sergio A. > > I've three views each with different URL. They are visible to logged >