When I render a page using the Django template renderer, I can pass in a dictionary variable containing various values to manipulate them in the page using {{ myVar }}
{{ myVar }}
A solution that worked for me is using the hidden input field in the template
Then getting the value in javascript this way,
var myVar = document.getElementById("myVar").value;