flask使用https运行

cooolr 于 2022-03-08 发布
from flask import Flask
app = Flask(__name__)

@app.route("/")
def hello():
    return "Hello World!"

if __name__ == "__main__":
    app.run(ssl_context=('cert.pem', 'key.pem'))
gunicorn --certfile cert.pem --keyfile key.pem -b 0.0.0.0:8000 hello:app