Skip to content

Instantly share code, notes, and snippets.

@acatejr
Last active January 21, 2019 12:31
Show Gist options
  • Save acatejr/3c932e60b471d4a450d5 to your computer and use it in GitHub Desktop.
Save acatejr/3c932e60b471d4a450d5 to your computer and use it in GitHub Desktop.
Rendering svg static files while running Django development server
# The django development server (1.9) does not seem to render svg files. In order to render them these lines
# can be added to the project's settings.py file. This may require restarting the django server and clearing the browser cache.
import mimetypes
mimetypes.add_type("image/svg+xml", ".svg", True)
mimetypes.add_type("image/svg+xml", ".svgz", True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment