from flask import Flask,jsonify
app = Flask(__name__)
#app.config['SERVER_NAME'] = 'example.com'
@app.route('/')
def hello_world():
data = {'data':[{'name': 'test', 'image': 'https://img3.doubanio.com/icon/u1074067-64.jpg', 'update': 1}]}
return jsonify(data)
if __name__ == '__main__':
app.run( debug=True, port=5000, ssl_context=('server.crt','server.key'))
pip install pyopenssl 用这个第三方包的话,
ssl_context=('server.crt','server.key') 替换成
ssl_context='adhoc'即可