Top "Jinja2" questions

Jinja2 is a fast template engine for Python.

How to write a multiline Jinja statement

I have an if statement in my Jinja templates which I want to write it in multines for readability reasons. …

jinja2
How to pass a list from Python, by Jinja2 to JavaScript

Let's say I have a Python variable: list_of_items = ['1','2','3','4','5'] …

javascript python variables jinja2
Ansible: filter a list by its attributes

I have variable named "network" registered in Ansible: { "addresses": { "private_ext": [ { "type": "fixed", "addr": "172.16.2.100" } ], "private_man": [ { "type": "fixed", "addr": "172.16.1.100" }, { "type": "…

jinja2 ansible
Jinja2 shorthand conditional

Say I have this: {% if files %} Update {% else %} Continue {% endif %} In PHP, say, I can write a shorthand conditional, like: &…

python jinja2
Rendering a python dict in Jinja2 / Werkzeug

I'm playing with a url shortener (basing it on the Shortly demo app from Werkzeug). I have a dict like …

python werkzeug jinja2
Reload Flask app when template file changes

By default, when running Flask application using the built-in server (Flask.run), it monitors its Python files and automatically reloads …

python flask jinja2
How do I include a HTML file in a Jinja2 template?

I am using Flask micro-framework for my server which uses Jinja templates. I have a parent template.html and some …

python html flask jinja2
how to iterate over a list of list in jinja

I have a list of list like : [[elem0, elem1, elem2], [elem3, elem4, elem5], [elem6, elem7, elem8], ...] I wrote the follow …

jinja2
Jinja2 inline comments

How can I put comments inside Jinja2 argument list declaration ? Everything I have tried gives an error: jinja2.exceptions.TemplateSyntaxError: …

python macros jinja2 comments
Flask Dynamic data update without reload page

i'm trying to create something like Google Suggest Tool (via suggest api http://suggestqueries.google.com/complete/search?output=toolbar&…

javascript jquery python flask jinja2