python编程快速上手(持续更新中…)
python实战网上书店项目(Flask技术点More))
单进程
# 保证app.run不会再次启动
if __name__ == '__main__':
# 生产nginx+uwsgi
app.run(host="0.0.0.0", port=8080, debug=app.config['DEBUG'])
多线程
app.run(host=“0.0.0.0”, port=8080, debug=app.config[‘DEBUG’], threadde=True
字典实现线程隔离
原理