简体   繁体   English

从Python启动gunicorn

[英]Start gunicorn from Python

Is there a way to kick off gunicorn from Python instead of command line? 有没有一种方法可以从Python而不是从命令行启动gunicorn? Not with subprocess or anything related to cmd line. 不能与子进程或与cmd行相关的任何东西一起使用。 Just using Python libraries. 仅使用Python库。

The reason I wanted to run it from Python is that, I have lots of libs and config dirs that are dependent on the path of where the program kick off. 我想从Python运行它的原因是,我有很多库和配置目录,它们依赖于程序启动的路径。

Thanks!!! 谢谢!!!

作为一个执行您想要做的事情的项目的示例,您可以看到气流使用gunicorn启动其Web服务器: https : //github.com/apache/incubator-airflow/blob/v1-9-stable/airflow /bin/cli.py#L675

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM