On Wed, 2009-02-11 at 11:18 -0800, SnappyDjangoUser wrote:
> Sorry for my recent absence in replies.... I was away from this work
> for a short while, but I am now back.
> 
> In response to Graham's question, I am not running multiple Django
> applications on the same host.  This is one Django app on one host.
> 
> Malcolm, thank you for the brief introduction to session key
> generation.  I was indeed counting the number of rows in the
> django_session table and expecting additions and deletions upon login/
> logout.  I now understand that this is not to be expected.
> 
> I have tried stepping through the code to catch the problem in action,
> but have thus far been unable to find where the error is.  My site
> uses the the @login_required() decorator on each method, but for
> debugging I moved it into my view function and walked through the
> function calls into the Django code.
> 
> One thing I noticed is that is_authenticated() in /<path_to_python>/
> django/contrib/auth/models.py is hard coded to always return True.  

That isn't correct. It always returns true for the User model, but not
for the AnonymousUser model (which is also in that file). This is
because a User model instance is only created for an authenticated user
by the auth application (if they aren't authenticated, an AnonymousUser
instance is created).

> I
> thought this was odd and do not understand the rational.  Is there a
> specific method that performs the authentication that I have
> overlooked?

http://docs.djangoproject.com/en/dev/topics/auth/#django.contrib.auth.authenticate

Regards,
Malcolm


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to