当我试图将Django应用程序部署到Heroku时,会遇到与python -将Django应用程序部署到Heroku - Stack溢出时发生的集合静态错误相同的问题
它开始构建、下载和安装所有东西,但这正是我在收集静态文件时得到的:
$ git push heroku master
Counting objects: 5375, done.
Total 5375 (delta 1092), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing requirements with pip
remote:
...
remote:
remote: ! Error while running '$ python manage.py collectstatic --noinput'.
remote: See traceback above for details.
remote:
remote: You may need to update application code to resolve this error.
remote: Or, you can disable collectstatic for this application:
remote:
remote: $ heroku config:set DISABLE_COLLECTSTATIC=1
remote:
remote: https://devcenter.heroku.com/articles/django-assets
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy....
remote:
remote: ! Push rejected to fierce-cove-94300.
remote:
To https://git.heroku.com/fierce-cove-94300.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/fierce-cove-94300.git'我试过了所有的答案,但没有帮助。另外,我尝试使用Django和静态资产- Heroku开发中心配置设置并安装whitenoise并提交更改。
这个问题没有得到解决。
发布于 2018-05-16 12:57:22
禁用自动收藏:
heroku config:set DISABLE_COLLECTSTATIC=1然后把你的项目推给heroku。完成部署后,手动收集如下所示:
heroku run python manage.py collectstatic如果仍然有错误,您的静态文件配置可能是原因。试着简化它,删除whitenoise,例如使用一个s3桶。
https://stackoverflow.com/questions/50371475
复制相似问题