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

pvcm50d1  于 11个月前  发布在  其他
关注(0)|答案(2)|浏览(151)

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

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/'

dced5bon

dced5bon1#

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

STATICFILES_STORAGE = 'whitenoise.storage.CompressedStaticFilesStorage'

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

c2e8gylq

c2e8gylq2#

此代码不工作:

STORAGES = {
    "staticfiles": {
        "BACKEND": "whitenoise.storage.CompressedManifestStaticFilesStorage", 
    },
}

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

STORAGES = {
    "staticfiles": {
        "BACKEND": "whitenoise.storage.CompressedStaticFilesStorage", 
    },
}


现在它起作用了。

相关问题