I'm trying to use jsonpickle to send an Object to front-end in JSON format. Here is the code:
#some code here...
return render(
request,
'template.html',
{
'json_values': jsonpickle.encode(values),
}
)
But, when I try to echo the string generated in my javascript code I'm getting this result when I call console.log({{json_values}})
:
[{'"id": 7, "novo_peso": "13"}, {"id": 13, "novo_peso": "17"}]
See the image below in console:
I'm using the last Google Chrome version. Am I doing something wrong?
Thank you