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

Posted

技术标签:

【中文标题】whitenoise.storage.MissingFileError:文件\'ecommerce/fonts/icofont.eot【英文标题】:whitenoise.storage.MissingFileError: The file 'ecommerce/fonts/icofont.eotwhitenoise.storage.MissingFileError:文件'ecommerce/fonts/icofont.eot 【发布时间】:2020-07-28 17:48:16 【问题描述】:

我正在尝试在 Heroku 上部署我的应用程序。它之前上传成功,但是,我做了一些更改,我尝试重新上传,但从那以后它一直没有响应。我不断收到此错误:whitenoise.storage.MissingFileError: The file 'ecommerce/fonts/icofont.eot' could not be found with .我该怎么办?

这是回溯:

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

我的 settings.py 文件中有这个


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

【问题讨论】:

【参考方案1】:

这来晚了,但我希望这对遇到此问题的人有所帮助,至少作为临时解决方案:

使用

STATICFILES_STORAGE = 'whitenoise.storage.CompressedStaticFilesStorage'

禁用 django 缓存机制,似乎有效。即使使用WHITENOISE_MANIFEST_STRICT = False

,这个错误也发生在我身上

http://whitenoise.evans.io/en/stable/django.html

【讨论】:

以上是关于whitenoise.storage.MissingFileError:文件'ecommerce/fonts/icofont.eot的主要内容,如果未能解决你的问题,请参考以下文章