首先安装gunicorn
pip install gunicorn
1
然后在入口文件的app.run()加上
from werkzeug.contrib.fixers import ProxyFix
app.wsgi_app = ProxyFix(app.wsgi_app)
1
2
如
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello World!'
if __name__ == '__main__':
from werkzeug.contrib.fixers import ProxyFix
app.wsgi_app = ProxyFix(app.wsgi_app)
app.run()
入口文件在哪里,自己建立吗???
我要做的环境是supervisor+gunicorn+nginx的flash项目