Django
Using with
{% with name="Kim" %}
Hello {{name}}!
{% endwith %}
With and =
{% with total=business.employees.count %}
{{ total }} employee{{ total|pluralize }}
{% endwith %}
With and as
{% with business.employees.count as total %}
{{ total }} employee{{ total|pluralize }}
{% endwith %}
Update variale with JS only
Django & JS
from django to JS
Or
{{ variable|json_script:'name' }}
var js_variable = JSON.parse(document.getElementById('name').textContent);