On 1 juin 09, at 18:40, "K.Berkhout" <[email protected]> wrote: > Hi, > > Is there a way I can access the "user.is_authenticated" method in > every view, without having to manually pass the User model to every > template? Basicly I want to show a login or logout link on every page, > depending on wether the visitor is logged in or not. I've included the > following if statement in my base template: > > {% if user.is_authenticated %} > Welcome {{ user }} , showing logout link... > {% else %} > Showing login link... > {% endif %} > > However, it only works with the standard "accounts/login" view, as > that view has acces to the user.is_authenticated method. > > Thanks, > > Kevin > Look up RequestContext.
--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

