when I am writing my Django view sometimes I pass as a context a JSON serialized object this way:
context = {'mydata': json.dumps(my_dictionary)}
return render(request, "mytemplate.html", context=context)
Then in mytemplate.html, in a js script, I do something like:
var myVar = {{ mydata }}
At this point PyCharm throws a warning about myVar, because that variable might not have been initialized since it doesn't recognise the django template tag as a valid value for a variable in javascript.
Now, I understand it is just a warning, but is there a clean way to get rid of it? Am I doing anything wrong?