gunicorn - 如果从shell脚本执行,则不接受配置文件

时间:2012-10-29 08:50:54

标签: python django bash shell gunicorn

这是我的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等,那么它就是选择。

1 个答案:

答案 0 :(得分:1)

使用此脚本,为我工作:

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