Re: Using a session variable in templates

2006-08-02 Thread Phil Powell

That sounds like just the thing I need - to hook into every request
and inject into the context dictionary.  Will give it a try.  Thanks
Chris!

On 01/08/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Context processors might work:
> http://www.djangoproject.com/documentation/templates_python/
>
> Chris
>
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Using a session variable in templates

2006-08-01 Thread [EMAIL PROTECTED]

Context processors might work:
http://www.djangoproject.com/documentation/templates_python/

Chris


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Using a session variable in templates

2006-08-01 Thread Phil Powell

Hi all,

I'm trying to implement something I'd imagine is quite simple, but
have come a bit unstuck when it comes to finding a graceful way to so
it.

What I want to do is sotre a random number (easy enough) in the users
session, then retrieve it in my base template (this is for the purpose
of selecting one of a number of different style sheets).  I've looked
at using middleware, but that would require me to set the variable in
each of my views?  I want to have this available for *every* template,
including flatpages.

Is there a simple way to do this?

-Phil

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---