django applying a style class based on a conditional
I have added class on if condition by this way....
<li class="nav-item {% if app_url == '/' %} active{% endif %}">
I normally go for:
<div class="item-image{% if foo %} own-image{% endif %}">...</div>
but switching out the entire div
tag may be more readable.
Either way I'd do the styling with another class, not with inline css.