我想使用Pycket会话管理器在会话中设置值。看看代码:
session = SessionManager(self)
session['key'] = 'OMG'
之后,在另一个处理程序中,我使用了以下代码:
^{pr2}$它写None
!我该怎么办?在
注意:redis在我的项目中运行良好,这是我的龙卷风设置:
if __name__ == "__main__":
tornado.options.parse_command_line()
app = tornado.web.Application(
url_patterns,debug=True,
cookie_secret="61oETz3455545gEmGeJJFuYh7EQnp2XdTP1o/Vo=",
xsrf_cookies= False,
template_path=os.path.join(os.path.dirname(__file__), "templates"),
static_path= os.path.join(os.path.dirname(__file__), "static"),
**{
'pycket': {
'engine': 'redis',
'storage': {
'db_sessions': 10,
'db_notifications': 11,
'max_connections': 2 ** 31,
},
'cookies': {
'expires_days': 120,
# 'domain' : SharedConnections.SiteNameUrl[SharedConnections.SiteNameUrl.index(".")+1,-1],
'domain' : 'domain.com',
},
},
}
)
用这种方式
我建议你用这个方法
^{pr2}$相关问题 更多 >
编程相关推荐