Hi I am currently working on a django project wherein I send multiple plotly charts as html code to the client side and try to store this html code in a dictionary I first make the chart and convert to HTML code
prediction_graph = prediction_graph.to_html(full_html=False)
then I send multiple such charts to client side. Here please note that charts itself is a dictionary.
return render(request, 'charts.html', {
"tickerList": charts["tickerList"],
"charts": json.dumps(charts)})
On client side I try to store it in a javascript variable
charts = {{ charts|safe }};
However the html tags/code present in this variable causes error.

Is there any way to solve this? like make it ignore the html tags/code