In views.py, I have time series data stored in a dictionary as follows:
views.py
time_series = {\"timestamp1\": occurrences, \"timestamp2\": occurrences}
If a frontend library needs a to parse JSON, you can use the json library to convert a python dict to a JSON valid string. Use the escapejs filter
json
escapejs
import json def foo(request): json_string = json.dumps() render(request, "foo.html", {'time_series_json_string': json_string})