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

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
主站蜘蛛池模板: 淅川县| 文化| 湄潭县| 武宣县| 浮梁县| 武陟县| 宁夏| 水城县| 新疆| 辽宁省| 淅川县| 侯马市| 连平县| 新乡县| 金溪县| 白朗县| 中卫市| 平果县| 蒲江县| 普安县| 安乡县| 正宁县| 孝感市| 香格里拉县| 桓仁| 冷水江市| 综艺| 大理市| 洛宁县| 通城县| 湄潭县| 澎湖县| 嘉祥县| 天镇县| 隆回县| 鄯善县| 元谋县| 自治县| 平陆县| 浦江县| 林州市|