Get javascript variable's value in Django url template tag
django, javascript, url
Solution
I found a trick that might work under most circumstances:
var url_mask = "{% url 'someview' arg1=12345 %}".replace(/12345/, tmp.toString());
It's clean, and it doesn't break DRY principle.
Problem
It is known that there's a DRY way of directing to an URL by using django template tag "url", say ``` {% url "someview" arg1=X %} ``` Here, I want "X" to be the value of a javascript variable, say `tmp`. But the following doesn't work ``` <script> ...{% url "someview" arg1=tmp %}... </script> ``` How should I get the value inside a template tag?