Flask总结

1、工程目录



2、快速搭建

pip3 install flask

main.py

from flask import Flask,request
import json

app = Flask('test')
f = open('test.log','w')

@app.route('/test', methods=['POST'])
def test():
    print(json.dumps(request.get_json(), sort_keys=True, indent=4, separators=(',', ':'),ensure_ascii=False), file=f)
    f.close()
    return ""

if __name__ == '__main__':
    app.run(debug=True, port=5005, host='0.0.0.0')

3、USGI

wsgi

pip3 install gunicorn
Copyright Curiouser all right reserved,powered by Gitbook该文件最后修改时间: 2023-08-11 11:32:06

results matching ""

    No results matching ""