I'm using ajax to asynchronously update a boolean variable in my Django project. I'm able to successfully display this variable using the template but I'm not sure how I can use this variable in the template's embedded python logic.
Basically
{% if JSON_BOOL %}
<p>this</p>
{% else %}
<p>that</p>
{% endif %}
Where the JSON_BOOL
is being supplied by an ajax function. What's the best way to make the variable available to the conditional logic? Thanks.