문제

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'
도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top