使用gevent启动bottle web框架

在gevent 1.3中gevent.wsgi已被弃用,所以使用1.2.2版本的gevent

pip install  gevent==1.2.2

在文件最前添加

from gevent import monkey;
monkey.patch_all()

启动语句

bottle.run(server='gevent', host='0.0.0.0', port=5000)
# 也可以考虑使用gunicorn启动
# pip install gunicorn
# bottle.run(server='gunicorn', host='0.0.0.0', port=5000)



猜你喜欢

转载自blog.51cto.com/wenguonideshou/2160840
今日推荐