Hi list,
I've got sessions with sub-apps working, but now I want to access the
session data in a sub-app's template.

In the main application.py I have:

def session_hook():

web.ctx.session = session

web.template.Template.globals['session'] = session


 app.add_processor(web.loadhook(session_hook))


But I'm getting global name 'session' is not defined when using $session in
a sub-app template.


I tried adding a load hook into my sub app like so:


def session_hook():

session = web.ctx.session

web.template.Template.globals['session'] = session

app_stations.add_processor(web.loadhook(session_hook))


But it doesn't work and I'm struggling. Am I on the right track?


Cheers, Josh.


-- 
joshua higgins
>>>>>>------

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to