Reputation: 9915
I'm trying to get gae-sessions working, but am having an issue.
I've logged inside of appengine_config.py and inside of webapp_add_wsgi_middleware and it is being called.
I've logged inside the libs __init__.py
and it's running __init__
, __call__
and my_start_response
inside SessionMiddleware without issue.
My problem is that the second I try to actually use the session with:
session = get_current_session()
I get this:
session = get_current_session()
File "gaesessions\__init__.py", line 38, in get_current_session
return _tls.current_session
AttributeError: 'thread._local' object has no attribute 'current_session'
Upvotes: 3
Views: 800
Reputation: 9915
Well the problem seems to be that I can only call get_current_session within a get request handler. If I try to call a function in another module from the get request handler, that itself requests the session, I get the above error.
Upvotes: 1