Search code examples
djangomime

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


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


Solution

  • 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