在编辑记录时,如果等待几分钟(喝咖啡)然后回来按保存(POST),我会被重定向到主页登录而不是数据丢失。
烧瓶登录会话似乎过期得太快了。
我做了一些研究并遇到了这个。
from flask import session, app
session.permanent = True
这是正确的方法吗?但即使我尝试这个,我也会得到这个异常:
File "/Users/kave/workspace/F11A/src/application/__init__.py", line 14, in <module>
session.permanent = True
File "/Users/kave/workspace/F11A/src/lib/werkzeug/local.py", line 355, in <lambda>
__setattr__ = lambda x, n, v: setattr(x._get_current_object(), n, v)
File "/Users/kave/workspace/F11A/src/lib/werkzeug/local.py", line 297, in _get_current_object
return self.__local()
File "/Users/kave/workspace/F11A/src/lib/flask/globals.py", line 20, in _lookup_req_object
raise RuntimeError('working outside of request context')
RuntimeError: working outside of request context