How do I access session data in Jinja2 templates (Bottle framework on app engine)?
Posted
by TylerW
on Stack Overflow
See other posts from Stack Overflow
or by TylerW
Published on 2010-03-31T15:19:58Z
Indexed on
2010/03/31
15:23 UTC
Read the original article
Hit count: 482
Hello! I'm running the micro framework Bottle on Google App Engine. I'm using Jinja2 for my templates. And I'm using Beaker to handle the sessions. I'm still a pretty big Python newbie and am pretty stoked I got this far :) My question is how do I access the session data within the templates? I can get the session data no problem within the actual python code. And I could pass the session data each time I call a jinja template. But since I need the session data in the main menu bar of the site... that means I would have to pass it on every single page. Does anyone know if I can access it directly in the templates?
For example I need the session data for my header links:
Home | FAQ | Login
or
Home | FAQ | Logout
Any help is greatly appreciated! :D
© Stack Overflow or respective owner