python簡單實用gunicorn部署


linux 安裝 pyuthon

 

安裝   pip install gunicorn

 

manage.py 文件

from app import create_app

app = create_app()

if __name__ == '__main__':
    app.run()

 

運行命令

gunicorn -D -b 0.0.0.0:12100 manage:app

-D 后台運行

 

gunicorn --access-logfile access.log --error-logfile error.log -D -b :12100 manage:app

access日志  

錯誤日志

gunicorn --timeout 20 --access-logfile access.log --error-logfile error.log -D -b :12100 manage:app


官網

http://docs.gunicorn.org/en/stable/run.html

 

https://www.jianshu.com/p/260f18aa5462

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM