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

  • 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
主站蜘蛛池模板: 鄢陵县| 中西区| 北海市| 宁德市| 长丰县| 阳西县| 昭通市| 定结县| 革吉县| 蒙自县| 美姑县| 高唐县| 文成县| 正镶白旗| 伊金霍洛旗| 启东市| 安阳市| 嫩江县| 时尚| 上犹县| 奉新县| 莎车县| 永顺县| 黑山县| 那曲县| 沈丘县| 霍林郭勒市| 西贡区| 武陟县| 裕民县| 成武县| 曲阳县| 政和县| 北宁市| 丰宁| 辽阳市| 洛宁县| 巴青县| 阿瓦提县| 信丰县| 固始县|