Accessing session variables in templates

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Accessing session variables in templates

Patrick J. Anderson

Hi!

I have a member_id session variable, which I set at login (it is
different than "user").

I need to check that variable in my templates to display member-specific
navigation.

How can I check do this? Or do I need to do the checking in each view
function and pass the value in a template variable?

Regards, Patrick


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Accessing session variables in templates

PatrickK-2

I didnĀ“t try that, but with a combination of the following it should  
work:

http://www.djangoproject.com/documentation/request_response/#attributes
http://www.djangoproject.com/documentation/templates_python/#django- 
core-context-processors-request

patrick


Am 12.10.2006 um 19:21 schrieb Patrick J. Anderson:

>
> Hi!
>
> I have a member_id session variable, which I set at login (it is
> different than "user").
>
> I need to check that variable in my templates to display member-
> specific
> navigation.
>
> How can I check do this? Or do I need to do the checking in each view
> function and pass the value in a template variable?
>
> Regards, Patrick
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---