Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
类中有一个initialize方法,tornado.web.RequestHandler每次有请求时都会调用它吗?
initialize
tornado.web.RequestHandler
是的,龙卷风要求initialize每个请求。
如果您想在请求之间共享状态(如数据库连接) - 将其存储在self.application.
self.application