32👍
✅
Problem solved. Wasn’t as dramatic as I thought. It so happens that django was converting html tokens such as ‘<‘ and ‘>’ to ‘<’ and ‘>’
This resulted in a correct output on the page, but inability to create the corresponding DOM objects.
the fix:
{% autoescape off %}
{% for book, book_desc in bd.items %}
books_description["{{ book }}"] = "{{ book_desc|escapenewline }}"
{% endfor %}
{% endautoescape %}
Took me a while.
If anyone comes across a similar issue here’s some intel on autoescaping
27👍
In case someone lands here for recent django versions, use:
{{ your_context_entry|safe }}
- [Django]-How do I make an auto increment integer field in Django?
- [Django]-Unique model field in Django and case sensitivity (postgres)
- [Django]-Django viewset has not attribute 'get_extra_actions'
Source:stackexchange.com