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 }}
I was facing simillar issue and answer suggested by S.Lott worked for me.
However I would like to point out major implementation limitation here. If you are planning to put your javascript code in different file and include that file in your template. This won't work.
This works only when you main template and javascript code is in same file. Probably django team can address this limitation.