December 2018
Beginner to intermediate
796 pages
19h 54m
English
Jinja2 is very similar to DTL in syntax. But it has a slightly different philosophy in certain places. For instance, in DTL the method call is implied as in the following example:
{% for post in user.public_posts %}
...
{% endfor %}
But in Jinja2, we invoke the public_posts method similar to a Python function call:
{% for post in user.public_posts() %}
...
{% endfor %}
This means that in Jinja2 you can call functions with arguments, unlike DTL. Refer to the Jinja2 documentation for more such subtle differences.
Jinja2 is usually chosen for the following reasons:
Read now
Unlock full access