Django 静态压缩文件无法在 Firefox 上呈现
我正在使用 django-static 进行优化< /strong> 静态样式表和 JavaScript。现在所有这些脚本和 CSS 属性都被加载到 Chrome 和 Safari 中。但由于某种原因,它们没有在 Firefox 中加载。我做错了什么吗? Firefox 是否需要其他设置?
如果需要更多信息,请发表评论。我会添加它。 (火狐版本 8)
编辑: 使用 Firebug 检查 Chrome 和 Firefox 后。我发现正在渲染的脚本与源一起使用,
src="/media/js/hawk\foo_boo_ajax_too_forms_refer_moder.1323864494.js
现在它被Chrome解释为
src="/media/js/hawk/foo_boo_ajax_too_forms_refer_moder.1323864494.js
但是firefox无法解释它。这是 Firefox 的问题还是我必须更改“/”? (正在生成的链接或源是由 django-static 生成的。)
I am using django-static for optimization of static stylesheets and javascripts. Now all these scripts and css properties are being loaded in Chrome and on Safari. But for some reason they are not loading in Firefox. Am i doing something wrong? Does Firefox require some other setting ?
If additional information is required please comment. I will add it. (Firefox version 8)
EDIT:
After checking Chrome and Firefox using Firebug. I found that the script being rendered was with the source as
src="/media/js/hawk\foo_boo_ajax_too_forms_refer_moder.1323864494.js
Now this is being interpreted by Chrome as
src="/media/js/hawk/foo_boo_ajax_too_forms_refer_moder.1323864494.js
But firefox is not able to interpret it. Is this a firefox issue or do i have to change the "/"? (The link or source being generated is by django-static. )
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
根据 URI 规范,您需要更改为“/”。
Per the URI spec, you need to change to '/'.
确保为 js 和 css 文件设置了正确的
Content-Type
和Content-Encoding
标头。make sure you have the correct
Content-Type
andContent-Encoding
headers set for your js and css files.上述问题是 django-static 中的一个错误。这个问题出现在Windows机器上。(在Windows上它混合了文件系统路径和URL。)我已经联系了开发人员,我认为这个问题很快就会得到解决。希望这对其他人有帮助。
The above said issue ,is a bug in django-static. This issue crops up on windows machine.(On windows it mixes up file system path and the url.)I have contacted the developer, and I think the issue will be solved soon. Hope this helps others.