Resource interpreted as Font but transferred with MIME type font/woff: | Django Framework

风流意气都作罢 提交于 2019-12-13 13:24:57

问题


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]

but How I do with Django, these rules


回答1:


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

In settings.py I think you need:

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

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

Resource interpreted as Font but transferred with MIME type application/x-font-woff
Django development server and MIME types



来源:https://stackoverflow.com/questions/18271257/resource-interpreted-as-font-but-transferred-with-mime-type-font-woff-django

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!