Flask 生产环境

https://stackoverflow.com/questions/51025893/flask-at-first-run-do-not-use-the-development-server-in-a-production-environmen

1
2
3
4
5
6
7
8
9
10
11
from flask import Flask

app = Flask(__name__)

@app.route("/")
def index():
return "<h1>Hello!</h1>"

if __name__ == "__main__":
from waitress import serve
serve(app, host="0.0.0.0", port=8080)
文章目录
|