On Thursday 20 Aug 2009 3:57:13 am John Barham wrote: > I could of course pass in the username as a dictionary value for each > page, but this quickly becomes tedious. I also use render_to_response > a lot and if I understand correctly it doesn't pass through the user > info automatically, but will if you set the context_instance parameter > to a RequestInstance. Is there a way I can access the user info from > any page without having to do the above?
use RequestContext - do not forget to add this in settings.py: TEMPLATE_CONTEXT_PROCESSORS = ( 'django.core.context_processors.request', You can then get the user as request.user in the template -- regards kg http://lawgon.livejournal.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---