No access to the login page to the already logged-in user through url

101 views
Skip to first unread message

rajat vijay

unread,
Apr 29, 2016, 4:40:37 PM4/29/16
to Django developers (Contributions to Django itself)
Hey, 
Thank in advance

I think that once the user has logged in he should not be able to access the template having the login form w/o getiing logged out.

Tim Graham

unread,
Apr 29, 2016, 9:19:30 PM4/29/16
to Django developers (Contributions to Django itself)
Django 1.10 adds a "redirect_authenticated_user" parameter for the login view which, if I understand correctly, accomplishes what you want.

https://docs.djangoproject.com/en/dev/topics/auth/default/#django.contrib.auth.views.login

rajat vijay

unread,
Apr 30, 2016, 6:15:13 AM4/30/16
to Django developers (Contributions to Django itself)
Yeah it accomplishes what I want but it's False by default and without extending the login view it will always be False.
What I am suggesting is it that by default the user should be redirected to another template(maybe a new one) when trying to access the login page.
I suggesting it to be default.

Shai Berger

unread,
Apr 30, 2016, 6:49:06 AM4/30/16
to django-d...@googlegroups.com
On Saturday 30 April 2016 13:05:38 rajat vijay wrote:
> Yeah it accomplishes what I want but it's False by default and without
> extending the login view it will always be False.
> What I am suggesting is it that by default the user should be redirected to
> another template(maybe a new one) when trying to access the login page.
> I suggesting it to be default.
>

So what would the default value be?

rajat vijay

unread,
Apr 30, 2016, 2:42:56 PM4/30/16
to Django developers (Contributions to Django itself)
Hey,
The default value is perfectly fine,
I just wanted to say that there can be a default template that the logged-in user be redirected if he tries to access the login page. 
Reply all
Reply to author
Forward
0 new messages