Skip to main content

Jinja

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 %}

Donate

The Pallets organization develops and supports Jinja and other popular packages. In order to grow the community of contributors and users, and allow the maintainers to devote more time to the projects, please donate today.

Metadata

Release files for Jinja2 3.1.3

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 3.1.3
File Size Uploaded
Jinja2-3.1.3.tar.gz 268.3 kB Details

Built distribution (wheel)

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

Total release size: 401.5 kB

Release files / Jinja2-3.1.3.tar.gz

Download URL Jinja2-3.1.3.tar.gz
Size 268.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ac8bd6544d4bb2c9792bf3a159e80bba8fda7f07e81bc3aed565432d5925ba90
BLAKE2b-256 checksum
How to use checksums
b25e3a21abf3cd467d7876045335e681d276ac32492febe6d98ad89562d1a7e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / Jinja2-3.1.3-py3-none-any.whl

Download URL Jinja2-3.1.3-py3-none-any.whl
Size 133.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d6d50dd97d52cbc355597bd845fabfbac3f551e1f99619e39a35ce8c370b5fa
BLAKE2b-256 checksum
How to use checksums
306d6de6be2d02603ab56e72997708809e8a5b0fbfee080735109b40a3564843
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release history Release notifications | RSS feed

3.1.6

2 release files

3.1.5

2 release files

3.1.4

2 release files

This release

3.1.3 This release

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

2.11.1

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