我正在尝试在Heroku上部署我的应用程序。它是成功上传之前,然而,我做了一些改变,我尝试重新上传,但它一直没有回应,从那时起。我一直收到这个错误:whitenoise.storage.MissingFileError:文件‘ecommerce/fonts/icofon.eot’找不到。,我能做些什么呢?
这是回溯:
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/'发布于 2021-09-09 19:44:40
这件事来得很晚,但我希望这能帮助那些遇到这一问题的人,至少作为一个暂时的解决办法:
使用
STATICFILES_STORAGE = 'whitenoise.storage.CompressedStaticFilesStorage'它禁用django缓存机制,似乎已经工作了。即使在WHITENOISE_MANIFEST_STRICT = False上,这个错误也发生在我身上。
http://whitenoise.evans.io/en/stable/django.html
https://stackoverflow.com/questions/61234135
复制相似问题