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

Uploaded Source

Built Distribution

Jinja2-2.11.1-py2.py3-none-any.whl (126.7 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: Jinja2-2.11.1.tar.gz
  • Upload date:
  • Size: 258.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.8.1

File hashes

Hashes for Jinja2-2.11.1.tar.gz
Algorithm Hash digest
SHA256 93187ffbc7808079673ef52771baa950426fd664d3aad1d0fa3e95644360e250
MD5 5d88c7e77aa63fc852a04f65dbfe5594
BLAKE2b-256 d803e491f423379ea14bb3a02a5238507f7d446de639b623187bccc111fbecdf

See more details on using hashes here.

File details

Details for the file Jinja2-2.11.1-py2.py3-none-any.whl.

File metadata

  • Download URL: Jinja2-2.11.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 126.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.8.1

File hashes

Hashes for Jinja2-2.11.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b0eaf100007721b5c16c1fc1eecb87409464edc10469ddc9a22a27a99123be49
MD5 945f0fc50f46e8f8310ff3184bcec0e7
BLAKE2b-256 27244f35961e5c669e96f6559760042a55b9bcfcdb82b9bdb3c8753dbe042e35

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 Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page