On Sun, 2009-02-15 at 15:23 -0800, Deniz Dogan wrote: > Hi > > I'm developing a website which will have a small menu at the top which > has a "login" link in it. However, if the user has already logged in, > it should be a "logout" link instead. This menu is part of a base > template which is extended in all of my other templates. > > So to for the templates to know whether the user has logged in or not, > should I pass request.user(.is_authenticated()) in each > render_to_response or is there a simpler solution?
If you consistently pass a RequestContext to render_to_responses, you'll always have access to a "user" variable in the context (one the standard context processors inserts it). Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---