Session with templates

18 views
Skip to first unread message

Tomas Schertel

unread,
May 28, 2012, 4:16:00 PM5/28/12
to we...@googlegroups.com
I'm trying to use session directly in templates, using instructions from cookbook [1] but I can't get it working.
Any help?
Here is the error message:

E:\tomas\projetos\synergie>c:\Python27\python.exe serve.py
Traceback (most recent call last):
  File "serve.py", line 5, in <module>
    import config
  File "E:\tomas\projetos\synergie\config\__init__.py", line 1, in <module>
    from config import *
  File "E:\tomas\projetos\synergie\config\config.py", line 18, in <module>
    view = web.template.render('app/views', base='base', cache=cache, globals={'context': session})
NameError: name 'session' is not defined


1 - http://webpy.org/cookbook/session_in_template

Leandro Severino

unread,
May 29, 2012, 8:03:28 AM5/29/12
to web.py
Hi friend,

in the file config.py, how to declare the session object ? show me
the code, please.

-- Leandro.

Reply all
Reply to author
Forward
0 new messages