Re: login page shouldn't open when I am already logged in, but it does !

2012-11-21 Thread Loai Ghoraba
Thanks for user.is_authenticated(), , but Django built in login view function doesn't call it before executing. So I guess I have to wrap Django login myself when using it. So the code will change to be this, I use this to wrap only Django login function-since I cannot modify it-, otherwise I

Re: login page shouldn't open when I am already logged in, but it does !

2012-11-21 Thread Daniel Roseman
On Wednesday, 21 November 2012 12:04:45 UTC, Loai Ghoraba wrote: > Well, thanks very much for your effort-y reply. I have read it and it is > useful, though it requires a second reading to recap :) > > Well, I thought of a simple solution and it worked: just having a wrapping > function around d

Re: login page shouldn't open when I am already logged in, but it does !

2012-11-21 Thread Loai Ghoraba
Well, thanks very much for your effort-y reply. I have read it and it is useful, though it requires a second reading to recap :) Well, I thought of a simple solution and it worked: just having a wrapping function around django login such that it checks whether the use is logged in or not before

Re: login page shouldn't open when I am already logged in, but it does !

2012-11-20 Thread Issam Outassourt
Hi, Well what you could do actually, and it's of commun use is to give your user a session-cookie id, which you can generate based on some informations in the header, typically his login, his ip adress, his password, his user-agent... As he tries to get the login page, challenge him by checking if

login page shouldn't open when I am already logged in, but it does !

2012-11-20 Thread Loai Ghoraba
Hi all I am trying to build a login page using Django auth app, it is all working nice but there is one problem: If I browse to accounts/login (the login url) when I am already logged in, in normal situation the login view shouldn't be rendered and the correct action will be to redirect to the