How do I pass a python list of JSON blobs to a django template so i can parse it from JSON into a javascript object?
With jquery I have tried the likes of $.parseJSON('{{list_of_JSON_blobs|escapejs}}') in the template, but the “string representation” of a python list is causing syntax errors.
Doing json.dumps(list_of_JSON_blobs) doesn’t work either as it stringfys the already serialised JSON blobs.
Currently I am doing dumps( [loads(blob) for blob in list_of_JSON_blobs]) but this is obviously not the optimal method!
worked it out:
use
join, and encapsulate the resulting string in paren