【发布时间】:2017-11-11 14:26:08
【问题描述】:
我正在尝试安装 jquery-ui-dist 包,当我运行 collectstatic 时,当 url 在样式表的引号内时,whitenoise 似乎有问题。
我得到的错误是:
MissingFileError: The file 'jquery-ui-dist/"images/ui-icons_555555_256x240.png"' could not be found with <whitenoise.storage.CompressedManifestStaticFilesStorage object at 0x7fb16b7000b8>.
The CSS file 'jquery-ui-dist/jquery-ui.css' references a file which could not be found:
jquery-ui-dist/"images/ui-icons_555555_256x240.png"
Please check the URL references in this CSS file, particularly any
relative paths which might be pointing to the wrong location.
我看到它似乎认为它正在寻找一个错误的文件名,因为它保留了引号,我认为原因是因为源文件有 url("images/ui-icons_555555_256x240.png") 而引号是不必要的,所以我跑了 @源文件上的987654323@,去掉了引号,还是报错。
我假设 whitenoise 或 jquery-ui-dist 包有问题,但在问题最终解决之前,我至少需要一个临时解决方案,我什至不确定在哪里实际问题出在哪里。
编辑:
我发现是 css 文件中的 cmets 导致了问题。我不知道为什么 whitenoise 会解析 cmets,我也不知道除了手动删除这些 cmets 之外我还能做什么。
【问题讨论】:
标签: python django whitenoise