CSS not loading wrong MIME type Django

后端 未结 5 2047
星月不相逢
星月不相逢 2020-12-03 21:59

I have installed virtualenv in my localhost to run a django app with 1.8 version but when running it the css and js files doesn\'t load.

I get

Resour         


        
5条回答
  •  既然无缘
    2020-12-03 22:48

    If you happen to be using the Django whitenoise plugin, then the mimetypes module is not used, and you need to pass in a dictionary of custom types in settings.py:

    WHITENOISE_MIMETYPES = {
        '.xsl': 'application/xml'
    }
    

提交回复
热议问题