Questions tagged [jinja2]

Jinja2 is a fast template engine for Python. It has full Unicode support, auto-escaping, inheritance, macros, and many other features.

Jinja2 is a fast template engine for Python. It is the default template engine in , can be integrated in other frameworks such as , or can be used without a framework. Features include:

  • Compose complex pages by inheriting from or including other templates
  • Automatic HTML escaping to prevent cross site scripting
  • Write reusable template macros and import them in other templates
  • Call functions with positional and keyword arguments
  • High performance with just in time compilation to Python bytecode
  • Optional ahead of time compilation
  • Optional sandboxed execution environment
  • Wide range of helpful functions for template designers
9474 questions
3
votes
1 answer

jinja2.exceptions.UndefinedError - no attribute 'favicon.ico'

I'm trying to run my flask application - which was working fine last night. However, this morning, attempting to run the same code (on a different computer, however), I'm getting the error: jinja2.exceptions.UndefinedError:…
TerryA
  • 58,805
  • 11
  • 114
  • 143
3
votes
0 answers

Jinja2 import context not following multiple extends

I have a master template that imports global macros. Another template extends the master template for a section of the site. The section template imports section-global macros with context. In the section-global macros, a global macro is accessed…
Logan Bibby
  • 1,167
  • 1
  • 10
  • 31
3
votes
0 answers

Jinja2 Dependencies During Render

I am trying to build a dependency graph from a render of a template and I am running into a bit of trouble trying to get good information out of jinja. I want to be able to render a template and get back a list/set of all of the files that were used…
Randy
  • 445
  • 5
  • 9
3
votes
1 answer

SSO implementation for GAE web application

I am trying to integrate the single sign on for my application running on Google app engine platform. I am using SAML 2.0 protocol to get this done. My organization already have the identity provider using LDAP, which configured in such a format…
Abhilash KK
  • 448
  • 5
  • 19
3
votes
2 answers

Is there a safe alternative to striptags in Jinja?

I noticed this behaviour while using pelican: Template('

{{text|striptags|striptags}}

').render(text='<script src="http://chezsoi.org"/>') is getting rendered as: