Skip to main content

A very fast and expressive template engine.

Project description

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.

In A Nutshell

.. code-block:: jinja

{% 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jinja2-3.1.4.tar.gz (240.2 kB view details)

Uploaded Source

Built Distribution

jinja2-3.1.4-py3-none-any.whl (133.3 kB view details)

Uploaded Python 3

File details

Details for the file jinja2-3.1.4.tar.gz.

File metadata

  • Download URL: jinja2-3.1.4.tar.gz
  • Upload date:
  • Size: 240.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for jinja2-3.1.4.tar.gz
Algorithm Hash digest
SHA256 4a3aee7acbbe7303aede8e9648d13b8bf88a429282aa6122a993f0ac800cb369
MD5 02ca9a6364c92e83d14b037bef4732bc
BLAKE2b-256 ed5539036716d19cab0747a5020fc7e907f362fbf48c984b14e62127f7e68e5d

See more details on using hashes here.

File details

Details for the file jinja2-3.1.4-py3-none-any.whl.

File metadata

  • Download URL: jinja2-3.1.4-py3-none-any.whl
  • Upload date:
  • Size: 133.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for jinja2-3.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 bc5dd2abb727a5319567b7a813e6a2e7318c39f4f487cfe6c89c6f9c7d25197d
MD5 a5fadd0603a10249348865e85a6f57bc
BLAKE2b-256 31803a54838c3fb461f6fec263ebf3a3a41771bd05190238de3486aae8540c36

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page