Hi Chris,

is_authenticated() on a User should always be true. The reason for this is
that you check the function on the request.user object. When a user is
logged in, it will be true, however, the AnonymousUser returns false, which
is the default when a user has not logged in.

So you can only check it in a view.

Regards,

Andréas


2014-07-29 17:08 GMT+02:00 Chris Seberino <cseber...@gmail.com>:

> I tried viewing the value of is_authenticated() for a user and it always
> is true...before and after logging in and after signing out.
>
> I'm trying to determine if a user has logged in or not.  Is this the right
> variable to use?  Why not changing?
>
> Thanks.
>
>
> cs
>
> --
> 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+unsubscr...@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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/a1ac670d-1406-452b-8868-aefd70d3e7cf%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/a1ac670d-1406-452b-8868-aefd70d3e7cf%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALXYUbnPe4DnbRTyd1-KnM3HOa25q9yYAVOx0GeQtPt-mLKrmQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to