[Answer]-Hand Stringarray to django template and use it in d3

1👍

What you are searching for is the ‘safe’ filter:

context = RequestContext(request,{"data":json.dumps(data)})

<script type="text/javascript">
    var dataArray = {{ data | safe }};

https://docs.djangoproject.com/en/dev/ref/templates/builtins/#std:templatefilter-safe

If you use variables more often in your javascript, it would probably make sense to turn off autoescape

Leave a comment