Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/278.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python gunicorn-如果从shell脚本执行,则不获取配置文件_Python_Django_Bash_Shell_Gunicorn - Fatal编程技术网

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

Python gunicorn-如果从shell脚本执行,则不获取配置文件,python,django,bash,shell,gunicorn,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文件中,如果我直接给出选项,比如-w3-error logfile等。。然后它就开始选择了。使用这个

这是我的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文件中,如果我直接给出选项,比如-w3-error logfile等。。然后它就开始选择了。

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


您需要给出
conf.py
文件的完整路径。
#!/bin/bash  
source /path/to/active
gunicorn_django -c $(pwd)/path/to/conffilefrom/presentworkingdirectory -D