i have this code:
{% if True %}
yo!
{% else %}
what?
{% endif %}
and the output is, of course, what? (of course, because i wouldn’t ask the question otherwise, would i?)
does True not exist in the template world?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That is kind of funny, and could possibly be considered a bug, but I imagine it has to do with the way template tags are processed. The first parameter to
ifis likely being treated as a context variable, so it’s looking upTruein the context dict, and of course, getting nothing because there’s noTruekey.