[Django]-Declare variable in template

5👍

You could use the with template tag.

{% with var=query.id %}
    ... use var in this template scope
{% endwith %}

You could also create your own template tag.

Leave a comment