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

{% 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.5.tar.gz (244.7 kB view details)

Uploaded Source

Built Distribution

jinja2-3.1.5-py3-none-any.whl (134.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: jinja2-3.1.5.tar.gz
  • Upload date:
  • Size: 244.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for jinja2-3.1.5.tar.gz
Algorithm Hash digest
SHA256 8fefff8dc3034e27bb80d67c671eb8a9bc424c0ef4c0826edbff304cceff43bb
MD5 083d64f070f6f1b5f75971ae60240785
BLAKE2b-256 af92b3130cbbf5591acf9ade8708c365f3238046ac7cb8ccba6e81abccb0ccff

See more details on using hashes here.

Provenance

The following attestation bundles were made for jinja2-3.1.5.tar.gz:

Publisher: publish.yaml on pallets/jinja

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: jinja2-3.1.5-py3-none-any.whl
  • Upload date:
  • Size: 134.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for jinja2-3.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 aba0f4dc9ed8013c424088f68a5c226f7d6097ed89b246d7749c2ec4175c6adb
MD5 837dcd1af6bb3940d8d6730977f2dcad
BLAKE2b-256 bd0f2ba5fbcd631e3e88689309dbe978c5769e883e4b84ebfe7da30b43275c5a

See more details on using hashes here.

Provenance

The following attestation bundles were made for jinja2-3.1.5-py3-none-any.whl:

Publisher: publish.yaml on pallets/jinja

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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