Top "Jinja2" questions

Jinja2 is a fast template engine for Python.

range in jinja2 inside a for loop

I have a nested list. I need to iterate through a list and keep it in for loop as shown …

python loops jinja2
Creating link to an url of Flask app in jinja2 template

In my Flask app, I have a view which displays a post @post_blueprint.route('/post/<int:year&…

python flask jinja2 url-for
How to build up a HTML table with a simple for loop in Jinja2?

I'm just learning Jinja2. I have never done any templating before so I find the documentation very confusing right now. …

jinja2
How do you sort a list in Jinja2?

I am trying to do this: {% for movie in movie_list | sort(movie.rating) %} But that's not right...the documentation …

python sorting jinja2
How to load jinja template directly from filesystem

The jinja API document at pocoo.org states: The simplest way to configure Jinja2 to load templates for your application …

python templates jinja2
Check if an array is not empty in Jinja2

I need to check if the variable texts is defined or not in index.html. If the variable is defined …

jinja2
How to convert string to uppercase / lowercase in Jinja2?

I am trying to convert to upper case a string in a Jinja template I am working on. In the …

python jinja2
Flask Template Not found

Implementing a simple static site from flask, but the browser says template not found, the shell returned 404 jinja2.exceptions.TemplateNotFound …

python flask jinja2
How do I render jinja2 output to a file in Python instead of a Browser

I have a jinja2 template (.html file) that I want to render (replace the tokens with values from my py …

python django jinja2
Check if key exists in a Python dict in Jinja2 templates

I have a python dictionary: settings = { "foo" : "baz", "hello" : "world" } This variable settings is then available in the Jinja2 template. …

python django jinja2