5

我正在尝试在 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/'
4

1 回答 1

2

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

使用

STATICFILES_STORAGE = 'whitenoise.storage.CompressedStaticFilesStorage'

它禁用了 django 缓存机制,似乎有效。这个错误发生在我身上,即使WHITENOISE_MANIFEST_STRICT = False

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

于 2021-09-09T19:44:40.790 回答