flask https code example
Example 1: flask
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello, World!'
Example 2: flask on gevent over https
# file: gevent_app_https.py
from flask_app import app
from gevent.pywsgi import WSGIServer
http_server = WSGIServer(('0.0.0.0', 443), app, keyfile='privkey.pem', certfile='cacert.pem')
http_server.serve_forever()
Example 3: Flask
pip install -U Flask