You will probably find that with Django you can get quotes. I recently had a similar problem with the Jinja2 template. In my case, JSON was going into an HTML data attribute and avoiding things wrong. After I used the filter to be safe, it stopped avoiding quotes and there were inconsistent quotes. The decision was
{% set dbl_quote='"' %} {{ encoded |replace(dbl_quote, '"') |safe}}
but it will probably look different in Django.
You may need to use {% autoescape off %} or something similar instead if you produce templates directly in Javascript, etc.
source share