centos7.4 部署flask项目之 gunicorn
pip install gunicorn
pip freeze > requirements.txt # 将当前虚拟环境中的依赖包生成至文件
pip install -r requirements.txt
gunicorn的基本常用使用命令
-
gunicorn -v
-
gunicorn manage:app -b 127.0.0.1:5000 (启动程序文件的目录下执行,绑定ip和port)
[2018-12-12 04:11:03 +0000] [6768] [INFO] Starting gunicorn 19.9.0
[2018-12-12 04:11:03 +0000] [6768] [INFO] Listening at:http://127.0.0.1:5000 (6768)
[2018-12-12 04:11:03 +0000] [6768] [INFO] Using worker: sync
[2018-12-12 04:11:04 +0000] [6773] [INFO] Booting worker with pid: 6773 -
pstree -ap|grep gunicorn