官术网_书友最值得收藏!

  • NGINX Cookbook
  • Tim Butler
  • 88字
  • 2021-07-03 00:04:30

Getting ready

This recipe is based on a very simple, single file Flask application. To show the simplicity, here's the example (demoapp.py) we'll use:

from flask import Flask 
application = Flask(__name__) 
 
@application.route("/") 
def hello(): 
    return "<h1>Demo via Nginx with uWSGI!</h1>" 
 
if __name__ == "__main__": 
    application.run(host='127.0.0.1', port=9001) 

Like the Django recipe, we're going to use uWSGI for the application server in this scenario as well. If you haven't installed uWSGI yet, the best way is to install the latest version via pip:

apt-get install python-pip python-dev
pip install uwsgi
主站蜘蛛池模板: 文安县| 荆门市| 墨玉县| 堆龙德庆县| 新乐市| 威信县| 筠连县| 滕州市| 宿迁市| 乐安县| 永新县| 迁西县| 安多县| 无棣县| 罗城| 新化县| 洪洞县| 大渡口区| 随州市| 西城区| 克拉玛依市| 社旗县| 五寨县| 武冈市| 庆城县| 双鸭山市| 攀枝花市| 永济市| 松阳县| 东乌| 沧州市| 泰来县| 瑞金市| 余干县| 定南县| 洛扎县| 乌拉特中旗| 怀宁县| 绥棱县| 津南区| 庆城县|