Skip to main content

Jinja is a fast, expressive, extensible templating engine. Special placeholders in the template allow writing code similar to Python syntax. Then the template is passed data to render the final document.

It includes:

  • Template inheritance and inclusion.

  • Define and import macros within templates.

  • HTML templates can use autoescaping to prevent XSS from untrusted user input.

  • A sandboxed environment can safely render untrusted templates.

  • AsyncIO support for generating templates and calling async functions.

  • I18N support with Babel.

  • Templates are compiled to optimized Python code just-in-time and cached, or can be compiled ahead-of-time.

  • Exceptions point to the correct line in templates to make debugging easier.

  • Extensible filters, tests, functions, and even syntax.

Jinja’s philosophy is that while application logic belongs in Python if possible, it shouldn’t make the template designer’s job difficult by restricting functionality too much.

Installing

Install and update using pip:

$ pip install -U Jinja2

In A Nutshell

{% extends "base.html" %}
{% block title %}Members{% endblock %}
{% block content %}
  <ul>
  {% for user in users %}
    <li><a href="{{ user.url }}">{{ user.username }}</a></li>
  {% endfor %}
  </ul>
{% endblock %}

Metadata

Release files for Jinja2 2.11.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Jinja2 2.11.1
File Size Uploaded
Jinja2-2.11.1.tar.gz 258.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Jinja2 2.11.1
File Interpreter ABI Platform
Jinja2-2.11.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 384.8 kB

Release files / Jinja2-2.11.1.tar.gz

Download URL Jinja2-2.11.1.tar.gz
Size 258.0 kB
Tags Source
SHA-256 checksum
How to use checksums
93187ffbc7808079673ef52771baa950426fd664d3aad1d0fa3e95644360e250
BLAKE2b-256 checksum
How to use checksums
d803e491f423379ea14bb3a02a5238507f7d446de639b623187bccc111fbecdf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.8.1

Release files / Jinja2-2.11.1-py2.py3-none-any.whl

Download URL Jinja2-2.11.1-py2.py3-none-any.whl
Size 126.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
b0eaf100007721b5c16c1fc1eecb87409464edc10469ddc9a22a27a99123be49
BLAKE2b-256 checksum
How to use checksums
27244f35961e5c669e96f6559760042a55b9bcfcdb82b9bdb3c8753dbe042e35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.8.1

Release history Release notifications | RSS feed

3.1.6

2 release files

3.1.5

2 release files

3.1.4

2 release files

3.1.3

2 release files

3.1.2

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0.3

2 release files

3.0.2

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.11.3

2 release files

2.11.2

2 release files

This release

2.11.1 This release

2 release files

2.11.0

2 release files

2.10

2 release files

2.9.6

2 release files

2.9.5

2 release files

2.9.4

2 release files

2.9.3

2 release files

2.9.2

2 release files

2.9.1

2 release files

2.9

2 release files

2.8.1

2 release files

2.8

2 release files

2.7.3

1 release file

2.7.2

1 release file

2.7.1

1 release file

2.7

1 release file

2.6

1 release file

2.5.5

1 release file

2.5.4

1 release file

2.5.3

1 release file

2.5.2

1 release file

2.5.1

1 release file

2.5

1 release file

2.4.1

1 release file

2.4

1 release file

2.3.1

1 release file

2.3

1 release file

2.2.1

1 release file

2.2

1 release file

2.1.1

4 release files

2.1

4 release files

2.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page