gpt4 book ai didi

python - gunicorn - 如果从 shell 脚本执行则不获取配置文件

转载 作者:太空宇宙 更新时间:2023-11-04 06:19:55 25 4
gpt4 key购买 nike

这是我的 shell 脚本的代码:

#!/bin/bash  
source /path/to/active
gunicorn_django -c /path/to/conf.py -D

上面的 sh 文件在执行时启动了 gunicorn 进程,但它没有使用配置文件。

但是,如果我直接从命令行执行命令,比如

gunicorn_django -c path/to/conf.py -D

然后它正在使用配置文件。

此外,在 sh 文件中,如果我直接提供选项,如 -w 3 -error-logfile 等。那么它正在接受选项。

最佳答案

使用这个脚本,对我有用:

#!/bin/bash  
source /path/to/active
gunicorn_django -c $(pwd)/path/to/conffilefrom/presentworkingdirectory -D

关于python - gunicorn - 如果从 shell 脚本执行则不获取配置文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13118362/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com