is there a way to use a .js variable as a parameter in a Django template url reverse call? The approach below does not work, which is not very surprising:
"fnRender": function ( o, val ) {
return '<a href="{% url update_task o.aData[0] %}">' + o.aData[1] +'</a>';
}
I know that I could pass the needed data via the Django view, but unfortunately I have to use the data from the .js library.
What I usually do is pass some sort of default parameter into the URL in the template, which acts as a sentinel which I can then replace dynamically in the Javascript. Something like: