Tag: Jinja2

Welcome to part 2 of my Jinja2 Tutorial. In part 1 we learned what Jinja2 is, what are its uses, and we started looking at templating basics. Coming up next are loops and conditionals, sprinkled with tests and a healthy dose of examples! Jinja2 Tutorial series Jinja2 Tutorial - Part 1 - Introduction and variable substitution Jinja2 Tutorial - Part 2 - Loops and conditionals Contents Control structures Loops Looping over dictionaries Conditionals and tests Comparisons Logical operators Truthiness Tests Loop filtering in Operator References GitHub repository with resources for this post Control structures In Jinja2 loops and conditionals come...

Continue reading »

This post is the first of the Jinja tutorial series where I'll provide an overview of the language, discussion of its features and a healthy dose of example use cases. If you're new to the world of templating, know what templates are but never used Jinja before, or simply need to refresh your memory, then you should found this series useful. Jinja2 Tutorial series Jinja2 Tutorial - Part 1 - Introduction and variable substitution Jinja2 Tutorial - Part 2 - Loops and conditionals Contents Introduction What is Jinja2? Where is it used? What is so good about it? Why would...

Continue reading »