I would check a couple of things.
1. Your session middleware is installed and configured.
2.     'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',

are in your installed apps

3. if your session mgr implementation is database based, which is the
case by default, that the sessions are created correctly and stored in
the appropriate table. AS an alternate, try changing your sessions to
memory based.

On Jun 10, 10:03 am, erincarter <[EMAIL PROTECTED]> wrote:
> I'm curious about this as well.
>
> I've been using the Django Registration App (http://code.google.com/p/
> django-registration/) and experiencing a similar issue. I have an
> almost identical method of "Hello, {{ user.username }}" in my base
> template. When a user has logged in and on any of the registration
> apps views ( 'r'^password/', 'r'^register/' ) the username displays
> correctly. However when the user navigates to my other apps views the
> username does not show up.
>
> I haven't spent much time researching the scenario but a solution to
> the issue 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to