The resource is interpreted as a font, but it is transferred with the MIME type font / woff: | Django framework

I know Apache One is adding

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

but how do I do it with Django, these rules

+4
source share
1 answer

So, are you serving static files on a Django dev server?

In settings.py it seems to me you need:

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

... from the information provided in these questions about SO:

The resource is interpreted as a font, but transmitted using an application such as MIME / x-font-woff
Django Development Server and MIME Types

+4
source

Source: https://habr.com/ru/post/1497406/


All Articles