Django 运行Git Push Heroku Master时将路径更改为manage.py
我刚刚成功地将Askbot forum部署到heroku,但有时在运行“git push heroku master”时,自动collectstatic进程失败(在我看来,这就像是随机失败),提示:Django 运行Git Push Heroku Master时将路径更改为manage.py,django,heroku,manage.py,askbot,Django,Heroku,Manage.py,Askbot,我刚刚成功地将Askbot forum部署到heroku,但有时在运行“git push heroku master”时,自动collectstatic进程失败(在我看来,这就像是随机失败),提示: ------>检测到Python应用程序 -----> Installing dependencies with pip Cleaning up... -----> Preparing static assets Collectstatic configuration er
------>检测到Python应用程序
-----> Installing dependencies with pip
Cleaning up...
-----> Preparing static assets
Collectstatic configuration error. To debug, run:
$ heroku run python ./askbot/setup_templates/manage.py collectstatic --noinput`
我真的不知道这是否是问题所在,但是.askbot/setup\u templates/
中的manage.py
包含应用程序的本机版本的文件,而不是我用于部署的文件,它位于应用程序的根目录中
如何使git push heroku master使用正确的manage.py
文件?更改文件中的路径。通常是这样的:
web: gunicorn hellodjango.wsgi --log-file -
调整它:
# from:
web: gunicorn .askbot/setup_templates/yourApp.wsgi
# to:
web: gunicorn .askbot/yourApp.wsgi
要检查路径是否确实是您的问题,请从终端运行此命令:
heroku run python ./manage.py collectstatic
# or
heroku run python ./yourApp.wsgi collectstatic
在
askbot/setup\u templates/
中删除或重命名Manage.py解决了该问题
Git Push Heroku Master永远不会在运行collectstatic
时失败
所以我认为,出于某种原因,可能是因为sys.path配置的缘故
Git Push Heroku Master首先发现并使用了
/askbot/setup\u templates/manage.py
而不是/manage.py
(这是正确的),并遇到了一个导入错误。Procfile是在我所说的manage.py collectstatic命令之后执行的,我的首要任务是修复该调用。无论如何谢谢你