Heroku上部署了app,出现You're using the staticfiles app without having set the STATIC_ROOT setting to。。。错误

1.在Heroku上部署app出现如下错误:

django.core.exceptions.ImproperlyConfigured: You're using the staticfiles app without having set the STATIC_ROOT setting to a filesystem path.

2.原因:

Heroku通过您的应用程序根目录中的两个文件之一来知道您的应用程序是一个Python应用程序:

  • Pipfile
  • requirements.txt

如果其中一个文件不在您的存储库的根目录中,那么Python buildpack将无法检测到您的应用程序


解决:

配置Pipfile文件和requiments.txt文件

Pipfile文件:

[[source]]

url = "https://pypi.python.org/simple"
verify_ssl = true

[packages]

django = "*"
gunicorn = "*"

[requires]

python_version = "3.6"

requirements文件:

dj-database-url==0.5.0
dj-static==0.0.6
Django==2.0.2
django-bootstrap3==9.1.0
gunicorn==19.7.1
psycopg2>=2.7.4
static3==0.7.0
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值