基于hi-nginx的web开发(python篇)——起步
hi-nginx不仅让python web 应用跑得飞快,而且让相关开发变得简单敏捷。 关于hi-nginx的安装,请参考:https://www.cnblogs.com/hi-nginx/p/8622561.html 人们常说flask框架又快又好。但是更hi-nginx比起来,还是太慢。比如flask的最小应用是这样的: 1 from flask import Flask 2 app = Flask(__name__) 3 4 @app.route('/') 5 def hello_world(): 6 return 'Hello World!' 7 8 if __name__ == '__main__': 9 app.run() 但是hi-nginx的最小python应用还要简单些: 1 if hi_req.uri()=='/test.py': 2 hi_res.content('hello,world') 3 hi_res.status(200) 当然,你也可以把最小应用写的更复杂些,,比如这样: 1 def hello_world(): 2 hi_res.content('h...