[Answered ]-Django – Template Vars in static JS files

2👍

You redesign your code in such a way that in the templates you make calls to javascript functions with the template variables as arguments:

<script type="text/javascript">
    x = foo({{ business }}, {{ some_other_variable }});
    alert(x);
</script>
👤shanyu

Leave a comment