Why doesn’t my condition logic work as expected in Jinja2/CherryPy?

This part of documentation can help you:

The special constants true, false and none are indeed lowercase.
Because that caused confusion in the past, when writing True expands
to an undefined variable that is considered false, all three of them
can be written in title case too (True, False, and None). However for
consistency (all Jinja identifiers are lowercase) you should use the
lowercase versions
.

Source: http://jinja.pocoo.org/docs/templates/

Try that code:

{% if bCat2 == true %}
<div>True</div>
{% else %}
<div>False</div>
{% endif %}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)