There'a an initialize
method in tornado.web.RequestHandler
class, is it called every time there's a request?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Yes, tornado calls initialize
for each request.
If you want to share state between requests(like db connection) - store it in self.application
.