1.文件目录
创建一个简单的flask 项目。。。
  
  application = Flask(__name__)
  application.debug = True

2.安装wsgi
pip install wsgi
在项目的根目录下创建wsgi.py
  from flask_pro  import application

  if __name__ == "__main__":
  application.run()


3.安装Gunicorn
  Gunicorn 绿色独角兽,是一个python WSGI UNIX 的HTTP服务器。这是一个pre-fork worker的模型, 从Runby的独角兽(Unicorn)项目移植。该Gunicorn服务器大致与各种Web框架兼容,只需要非常简单的执行,轻量级的资源消耗。
  pip install gunicorn

4.使用守护进程运行
  nohup gunicorn -w 4 -b 0.0.0.0:8080 wsgi:application &

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-20
  • 2022-12-23
  • 2022-12-23
  • 2021-10-15
  • 2021-12-02
猜你喜欢
  • 2021-11-02
  • 2021-04-29
  • 2021-05-23
  • 2021-05-30
  • 2021-07-20
相关资源
相似解决方案