Why create loops and branching with the name of the variable in the condition?

In django documentation there is this html code:

{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}


Here the condition is the name of the variable, if you remove the condition, the code still works, please tell me, what is the meaning of such terms, which in any case are performed. Also seen similar with a while loop.
April 3rd 20 at 18:23
3 answers
April 3rd 20 at 18:25
Solution
The point is not to load the DOM with empty tags.
In General, an empty house-the nodes are very visible. First and foremost is the sense in that - Zechariah_Beat commented on April 3rd 20 at 18:28
April 3rd 20 at 18:27
Solution
{% if error_message %} would work if the variable error_message defined
April 3rd 20 at 18:29
Solution
The point in standardization

Find more questions by tags Django