Shots in the dark -- you are passing a RequestContext, not a regular
old Context, into your main template?  And you've got
django.core.context_processors.auth in your TEMPLATE_CONTEXT_PROCESSORS
setting?

Karen

John M wrote:
> I'm trying out the login / logout methods from a simple webpage, and am
> having some real trouble here.
>
> My main page has a link to /accounts/login, setup according to the
> docs, allows the user to fill in a name and password, hit OK, and viola
> they are logged in.
>
> On the main page, i check to see if the user is logged in or not:
>
>       {% if user.is_authenticated  %}
>               You're logged in
>       {% else %}
>               you're not logged in
>       {% endif %}
>
> the problem is, this code always says they are not logged in, even
> though, I know I just logged in.
>
> So, I write a link to check the user logged in:
>
>       <a href="check/"> Check user </a>
>
> in my views.py i have :
>
> def check(request):
>       return HttpResponse("The current user is %s" % request.user.username)
>
> And that always shows me the correct user that's logged in
> 
> WHAT AM I MISSING HERE?


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to