On Sun, Jun 29, 2008 at 9:08 AM, Bobby Roberts <[EMAIL PROTECTED]> wrote:
>
> So I have to explicitly pass the session variables to the template to
> use them?  That kind of defeats the purpose of session variables
> doesn't it?  If they are in session we should be able to access them
> easier than passing them from view to template throughout our
> application.

Variables that happen to hold session data are no different from other
variables.

If you want to have access to a variable in a template, you'll have to
make the variable available to the template somehow.  You can do this
by passing the variable to the template yourself, or (in some cases)
you can have a context processor do that for you.

This is one of those cases: you can have request.session added
implicitly if you do what Daniel Roseman wrote and active the
django.core.context_processors.request context processor, making sure
to always use a RequestContext when rendering the template.


Arien

--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to