I am curious about this as well. I've been using the Django Registration App (http://code.google.com/p/ django-registration/). I have an almost identical "Hello, {{ user.username }}" in the base template. Once logged in, user.is_authenticated() works fine (shows the user name) on all the registration app views ('r'^password','r'^register') however all of my other app views using user.is_authenticated() shows as False and no user name is displayed.
I haven't spent a much time researching the scenario but a solution would be greatly appreciated. Thanks for posting this bcrem. On Jun 9, 1:21 pm, bcrem <[EMAIL PROTECTED]> wrote: > Hello, > > I'm trying to set up a user login form; that's working fine, however > when I navigate after login to my home page and try to do a simple > "Hello, <username>" I'm getting a False from user.is_authenticated(). > > Here're some relevant snippets: > > From the login handler: > > uName = request.POST['username'] > uPass = request.POST['password'] > user = authenticate(username=uName, password=uPass) > > if user is not None: > if user.is_active: > login(request, user) > return HttpResponseRedirect(next) > else: > message = 'Account Deactivated' > > From the index view handler: > > user = get_user(request) > > if user.is_authenticated(): > message = 'Welcome back!' > else: > message = 'Welcome.' > > What am I missing here? The index() function is in a separate view > file; however even if I move it to the same file as the login handler, > I get the same behavior. Do I need to do something beyond calling > login() to make the user persistant across all request contexts? > > Thanks in advance for any info... --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

