Python gunicorn-如果从shell脚本执行,则不获取配置文件
这是我的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等。。然后它就开始选择了。使用这个
#!/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