django中传递到页面中的并不是变量, 是文本的替换
http://stackoverflow.com/questions/298772/django-template-variables-and-javascript上下面这句话解释的很清楚。
The {{variable}}
is substituted directly into the HTML. Do a view source; it isn't a "variable" or anything like it. It's just text.
Having said that, you can put this kind of substitution into your javascript
<script type="text/javascript">
var a = "{{someDjangoVariable}}";
</script>
gives you "dynamic" javascript