heroku whitenoise.storage.MissingFileError:文件'ecommerce/fonts/icofont.eot

pvcm50d1  于 2024-01-08  发布在  其他
关注(0)|答案(2)|浏览(235)

我正在尝试在Heroku上部署我的应用程序。之前它已成功上传,但是,我做了一些更改,并尝试重新上传,但此后一直没有响应。我一直收到此错误:**whitenoise.storage.MissingFileError:文件'ecommerce/fonts/icofont.eot'无法找到。**我该怎么办?
这就是traceback:

  1. whitenoise.storage.MissingFileError: The file 'ecommerce/fonts/icofont.eot' could not be found with <whitenoise.storage.CompressedManifestStaticFilesStorage object at 0x7f73c4861320>.
  2. remote: The CSS file 'ecommerce/css/icofont.css' references a file which could not be found:
  3. remote: ecommerce/fonts/icofont.eot
  4. remote: Please check the URL references in this CSS file, particularly any
  5. remote: relative paths which might be pointing to the wrong location.
  6. remote: Sentry is attempting to send 0 pending error messages
  7. remote: Waiting up to 2 seconds
  8. remote: Press Ctrl-C to quit

字符串
我在settings.py文件中有这个

  1. STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
  2. STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
  3. STATIC_URL = '/static/'

dced5bon

dced5bon1#

这来得很晚,但我希望这将有助于遇到这个问题的人,至少作为一个临时解决方案:
使用

  1. STATICFILES_STORAGE = 'whitenoise.storage.CompressedStaticFilesStorage'

字符串
禁用了django缓存机制,似乎已经起作用了。即使使用WHITENOISE_MANIFEST_STRICT = False,这个错误也会发生在我身上。
http://whitenoise.evans.io/en/stable/django.html

c2e8gylq

c2e8gylq2#

此代码不工作:

  1. STORAGES = {
  2. "staticfiles": {
  3. "BACKEND": "whitenoise.storage.CompressedManifestStaticFilesStorage",
  4. },
  5. }

字符串
然后我把它改成了这个

  1. STORAGES = {
  2. "staticfiles": {
  3. "BACKEND": "whitenoise.storage.CompressedStaticFilesStorage",
  4. },
  5. }


现在它起作用了。

展开查看全部

相关问题