Reputation: 15
Like the python variable has a list of values and I want to equate a variable, say var list= python variable inside tag.
Upvotes: 1
Views: 2367
Reputation: 26
Variable tags in Django are surrounded by {{
and }}
and they're replaced with values when the template is evaluated. That being said, you can make use of the Django variables in JavaScript as follow:
<script type="text/javascript">
var list = "{{djangoVariable}}"
</script>
Upvotes: 1