Welcome to Jinja2¶
Jinja2 is a modern and designer-friendly templating language for Python, modelled after Django’s templates. It is fast, widely used and secure with the optional sandboxed template execution environment:
<title>{% block title %}{% endblock %}</title>
<ul>
{% for user in users %}
<li><a href="{{ user.url }}">{{ user.username }}</a></li>
{% endfor %}
</ul>
Features:
- sandboxed execution
- powerful automatic HTML escaping system for XSS prevention
- template inheritance
- compiles down to the optimal python code just in time
- optional ahead-of-time template compilation
- easy to debug. Line numbers of exceptions directly point to the correct line in the template.
- configurable syntax
Jinja2 Documentation¶
Additional Information¶
- Frequently Asked Questions
- Why is it called Jinja?
- How fast is it?
- How Compatible is Jinja2 with Django?
- Isn’t it a terrible idea to put Logic into Templates?
- Why is Autoescaping not the Default?
- Why is the Context immutable?
- My tracebacks look weird. What’s happening?
- Why is there no Python 2.3/2.4/2.5/3.1/3.2 support?
- My Macros are overridden by something
- Jinja2 Changelog
- Version 2.8.1
- Version 2.8
- Version 2.7.3
- Version 2.7.2
- Version 2.7.1
- Version 2.7
- Version 2.6
- Version 2.5.5
- Version 2.5.4
- Version 2.5.3
- Version 2.5.2
- Version 2.5.1
- Version 2.5
- Version 2.4.1
- Version 2.4
- Version 2.3.1
- Version 2.3
- Version 2.2.1
- Version 2.2
- Version 2.1.1
- Version 2.1
- Version 2.0
- Version 2.0rc1
If you can’t find the information you’re looking for, have a look at the index or try to find it using the search function: