djangomime-typesgoogle-chrome-devtoolsdjango-dev-server

Django development server and MIME types


Is there anyway of setting MIME types in the django development server? Specifically, I would love to remove this message from the warnings in Chrome dev tools.

Resource interpreted as Image but transferred with MIME type image/x-png

Solution

  • Turns out it was as simple as adding

    if DEBUG:
        import mimetypes
        mimetypes.add_type("image/png", ".png", True)
    

    to settings.py