The tool used in this recipe, Jinja2, reads a file that contains the template and applies the context to it. The context contains the data to be displayed.
We should start by installing the module:
$ echo "jinja2==2.20" >> requirements.txt
$ pip install -r requirements.txt
Jinja2 uses its own syntax, which is a mixture of HTML and Python. It is aimed at HTML documents so it easily performs operations such as correctly escaping special characters.
In the GitHub repository, we've included a template file called jinja_template.html with the template to use.