(r'^login/?$',login,{'template_name':'login.html', 'authentication_form':CustomAuthenticationForm}),
Right now, I do this. I utilize Django’s login system.
But, when I’m logged in, it still redirects me to the login page.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are two options, depending on the behavior you want.
As S. Lott says, just don’t send people over to the login page from the get go, only use the decorator or is_authenticated() call and redirect users there when needed, and you go “around” your problem.
If for some reason people are getting to your login page (landing page, deep linking and so on), you can use the is_authenticated on your view and manually redirect them when they do get there. I’ve used this in the past when I implemented SSO with Facebook for example.