tornado
wanghui_gytj
这个作者很懒,什么都没留下…
展开
-
Tornado静态文件
settings = dict( template_path=os.path.join(os.path.dirname(__file__),"blog/template"), static_path=os.path.join(os.path.dirname(__file__),"static"), static_url_prefix='/blog/' ) ap原创 2017-07-19 20:15:57 · 773 阅读 · 0 评论 -
Tornado 多进程模式
官方文档的helloworld实例中的启动方法:if __name__ == "__main__": application.listen(8888) # listen is a shortcut for bind and start ,这点看httpserver.py可以得知 tornado.ioloop.IOLoop.instance().start()并且在lis原创 2017-07-19 20:17:07 · 1048 阅读 · 0 评论 -
tornado 自定义错误页面
找了好久Tornado自定义页面的放发 有人这么写的class ErrorHandler(RequestHandler): #大约1413行 这里主要是‘文件url的404’"""Generates an error response with status_code for all requests."""def initialize(self, status_code): sel原创 2017-07-19 20:08:40 · 1390 阅读 · 0 评论