资源解释为字体,但以MIME类型font / woff:|传输Django框架 [英] Resource interpreted as Font but transferred with MIME type font/woff: | Django Framework

查看:790
本文介绍了资源解释为字体,但以MIME类型font / woff:|传输Django框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道在Apache One中添加

I know in Apache One adds

RewriteEngine On
RewriteRule !(\.ico\.gif|\.png|\.jpe?g|\.css|\.js|\.php|\.eot|\.svg|\.ttf|\.woff|\.otf|^public/.*)$ index.php [nocase,last]

但是如何那么这个规则就是使用Django吧。

but How I do with Django, these rules

推荐答案

那么你在Django开发服务器中提供静态文件?

So, you are serving static files in Django dev server?

settings.py 我认为你需要:

if DEBUG:
    import mimetypes
    mimetypes.add_type("application/font-woff", ".woff", True)

...从这些问题中给出的信息SO:

...from info given in these questions on SO:

资源解释为字体,但使用MIME类型应用程序/ x字体传输-woff

Django开发服务器和MIME类型

这篇关于资源解释为字体,但以MIME类型font / woff:|传输Django框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆