【问题标题】:gunicorn - not taking config file if executed from shell scriptgunicorn - 如果从 shell 脚本执行,则不获取配置文件
【发布时间】:2012-10-29 08:50:54
【问题描述】:

这是我的 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 等。那么它正在接受选项。

【问题讨论】:

  • 您需要提供conf.py 文件的完整路径。

标签: python django bash shell gunicorn


【解决方案1】:

使用这个脚本,为我工作:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-08-24
    • 2013-01-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-12
    • 2013-04-08
    相关资源
    最近更新 更多