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

  • 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
主站蜘蛛池模板: 富民县| 红桥区| 和林格尔县| 广丰县| 许昌县| 天柱县| 万宁市| 昌图县| 东乡| 榆树市| 青海省| 桐城市| 南平市| 黄大仙区| 昌邑市| 滦平县| 奉节县| 濉溪县| 嘉禾县| 翼城县| 峨山| 峡江县| 金湖县| 张北县| 肥城市| 武安市| 武胜县| 揭西县| 平遥县| 宿松县| 且末县| 阿荣旗| 宝坻区| 澎湖县| 西和县| 西平县| 汉沽区| 慈溪市| 大足县| 昌江| 万载县|