Django development server and MIME types

Fergal Moran picture Fergal Moran · Apr 30, 2013 · Viewed 8.5k times · Source

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

Answer

Fergal Moran picture Fergal Moran · May 3, 2013

Turns out it was as simple as adding

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

to settings.py