Top "Jinja2" questions

Jinja2 is a fast template engine for Python.

How to validate Jinja syntax without variable interpolation

I have had no success in locating a good precommit hook I can use to validate that a Jinja2 formatted …

validation syntax jinja2 pre-commit-hook
How can I pass JSON data into a Nunjucks template?

I want to use Nunjucks templates but want to pass in my own JSON data to be used on the …

jinja2 nunjucks
How to include a template with relative path in Jinja2

I'm trying, in a template, to include another one that is in the same folder. To do so, i'm just …

python templates include render jinja2
Ansible register variable in task and use it in template

In the Ansible task, how to register a variable so I can use it as check statement in Template. The …

ansible jinja2 ansible-2.x ansible-template
How do you debug Mako templates?

So far I've found it impossible to produce usable tracebacks when Mako templates aren't coded correctly. Is there any way …

python debugging templates jinja2 mako
Getting started with Cherrypy and Jinja2

This is my first time delving into web development in python. My only other experience is PHP, and I never …

python-2.7 frameworks jinja2 cherrypy
How to csrf_token protection in jinja2 template engine?

In Django template I used: <form action="/user" method="post">{% csrf_token %} {{ form.as_p|safe }} <input …

django csrf jinja2
Set WTForms submit button to icon

I want a submit button that displays an icon rather than text. The button is a field in a WTForms …

python flask jinja2 wtforms iconic
Multiple blocks of same name in Jinja2

In Jinja2, I have a base template like this: <title>{% block title %}{% endblock %} - example.com</title&…

python html templates jinja2
How to filter dictionaries in Jinja?

I have a dictionary of packages with package-name being the key and a dictionary of some details being the value: { "…

dictionary ansible jinja2 jmespath