Skip to main content

A very fast and expressive template engine.

Project description

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

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Jinja2-3.1.1-py3-none-any.whl (132.6 kB view details)

Uploaded Python 3

File details

Details for the file Jinja2-3.1.1.tar.gz.

File metadata

  • Download URL: Jinja2-3.1.1.tar.gz
  • Upload date:
  • Size: 267.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for Jinja2-3.1.1.tar.gz
Algorithm Hash digest
SHA256 640bed4bb501cbd17194b3cace1dc2126f5b619cf068a726b98192a0fde74ae9
MD5 964afcd0853f67f20f7b2e34e5935564
BLAKE2b-256 89e3b36266381ae7a1310a653bb85f4f3658c462a69634fa9b2fef76252a50ed

See more details on using hashes here.

File details

Details for the file Jinja2-3.1.1-py3-none-any.whl.

File metadata

  • Download URL: Jinja2-3.1.1-py3-none-any.whl
  • Upload date:
  • Size: 132.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for Jinja2-3.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 539835f51a74a69f41b848a9645dbdc35b4f20a3b601e2d9a7e22947b15ff119
MD5 cae2986094602b6c2d6f4405e8d0eb3b
BLAKE2b-256 7602af4045156cde8feeefa30cb1c051e10321d4960c418bd52346a497feb302

See more details on using hashes here.

Supported by

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