I am trying to pass a python list with string values from views.py to the template where a javascript uses the same for labels of a pie chart(plotly). The issue is when the list is received at the front-end, the list is getting the hexcode of the quote which is ' instead of the quotes. How to convert it to quote? Here is the snippet:
var trace1 = {
x: {{labels}},
y: {{values}},
marker:{
color: ['rgba(204,204,204,1)', 'rgba(222,45,38,0.8)', 'rgba(204,204,204,1)', ]
},
type: 'bar'
};
Now, i am getting the values for 'labels' as:
['One', 'Two', 'Three']
Instead of:
['One','Two','Three']
Just wanted to know are there any methods to avoid this easily instead of using string replace methods?