You might want to check if the context being passed to your template is a regular Context or a RequestContext. Only RequestContexts have the request.user available. Check the context_instance parameter in render_to_response: http://docs.djangoproject.com/en/dev/topics/http/shortcuts/#render-to-response
On Dec 30, 1:43 am, "Antoni Aloy" <[email protected]> wrote: > 2008/12/29 madhav <[email protected]>: > > > As a part of django user authentication, when is request.user becomes > > None?? As I have read in the docs, it will either > > django.contrib.auth.User or AnonymousUser, but I am getting a very > > weird error telling request.user is None. Please help me out. When I > > am trying to call request.user.is_authenticated(), it is raising an > > error telling request.user doesn't exist. I am using Django 1.0 > > (version:8961). Please help me out. :( > > Hello! > > If request.user is None means that you don't have a user object, so > you cant access to its properties. > So double check that you have SessionMiddleware and > AuthenticationMiddleware configured in your settings.py, and if it > fails give more information about how you're accessing to the User > object. > > Hope it helps! > > -- > Antoni Aloy López > Blog:http://trespams.com > Site:http://apsl.net --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---

