12👍
✅
You can try to prevent string escape in template like this:
{{ variable|safe }}
In-view way:
from django.utils.safestring import mark_safe
from django.template import Context
data=mark_safe(data)
inescapable = Context({'data': data}, autoescape=False)
0👍
I know this is old but other people might stumble upon this with the same problem
Try
{% autoscape off %} {{ date }} {% endautoscape %}
It worked fine for me
- [Django]-Any clue on this error with generic relation using Django Orm?
- [Django]-How to join multiple params dynamically for django Q object
- [Django]-Syntax error whenever I put Python code inside a Django template
- [Django]-Mod_wsgi (3.4-14) / Apache 2.4.12 / Red Hat (6.7) / Django 1.8.2 hanging under load
- [Django]-Python – Check if user is in team or not
0👍
When requesting graphs from google charts the data must be sent as a text array. The csv file has to be pure text with no apostrophes.
however
code fragment
data = repr(textData)
returns data bounded by ‘ ‘
this is interpreted as "'" in html
The solution to this is to javascript split method
var par = textData.split(""'") textArray = par[1] // the part without '
rest of code
👤pmr
- [Django]-Crontab is running but still not executing command Django
- [Django]-Pass data from one view to another django
- [Django]-Return object when aggregating grouped fields in Django
- [Django]-Disadvantages of sharing Django sessions on multiple subdomains
- [Django]-Django .."join" query?
Source:stackexchange.com