I have a google app engine app that is using Django templates. I am trying to do this:
{% if person.age >= 4 %}
<p style="color:White">Hello</p>
{% else %}
<p style="color:Black">Hello</p>
{% endif %}
This doesn’t work, I get: “TemplateSyntaxError: ‘if’ statement improperly formatted”. Meanwhile (because some values are None) this does work:
{% if person.age %}
<p style="color:White">Hello</p>
{% else %}
<p style="color:Black">Hello</p>
{% endif %}
I dont see why the first example doesnt work, here is the link to Django Templates I think I am following the operator examples close enough other than the fact that this is a property and not a variable
What Django version are you using?
The default version on App Engine is 0.96, and the
>=operator was not supported until 1.2.You can switch to 1.2 by adding this above any of your template-related imports: