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.

Contributing

See our detailed contributing documentation for many ways to contribute, including reporting issues, requesting features, asking or answering questions, and making PRs.

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.6.tar.gz (245.1 kB view details)

Uploaded Source

Built Distribution

jinja2-3.1.6-py3-none-any.whl (134.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: jinja2-3.1.6.tar.gz
  • Upload date:
  • Size: 245.1 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.6.tar.gz
Algorithm Hash digest
SHA256 0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d
MD5 66d4c25ff43d1deaf9637ccda523dec8
BLAKE2b-256 dfbff7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b

See more details on using hashes here.

Provenance

The following attestation bundles were made for jinja2-3.1.6.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.6-py3-none-any.whl.

File metadata

  • Download URL: jinja2-3.1.6-py3-none-any.whl
  • Upload date:
  • Size: 134.9 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67
MD5 845b37cea56edd0f4dbd949244e9d798
BLAKE2b-256 62a13d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56

See more details on using hashes here.

Provenance

The following attestation bundles were made for jinja2-3.1.6-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 Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page