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.0.0a1.tar.gz (249.7 kB view details)

Uploaded Source

Built Distribution

Jinja2-3.0.0a1-py3-none-any.whl (121.5 kB view details)

Uploaded Python 3

File details

Details for the file Jinja2-3.0.0a1.tar.gz.

File metadata

  • Download URL: Jinja2-3.0.0a1.tar.gz
  • Upload date:
  • Size: 249.7 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-3.0.0a1.tar.gz
Algorithm Hash digest
SHA256 c922560ac46888d47384de1dbdc3daaa2ea993af4b26a436dec31fa2c19ec668
MD5 c28b294177e9dd3dfa8b159face6c8a2
BLAKE2b-256 36cc5cd404a00f1b93bc830505c7a78553d9f49f7152c336466fc206790cc26c

See more details on using hashes here.

File details

Details for the file Jinja2-3.0.0a1-py3-none-any.whl.

File metadata

  • Download URL: Jinja2-3.0.0a1-py3-none-any.whl
  • Upload date:
  • Size: 121.5 kB
  • Tags: 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-3.0.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 c10142f819c2d22bdcd17548c46fa9b77cf4fda45097854c689666bf425e7484
MD5 78133712343652e954918b783302b468
BLAKE2b-256 3bc4d9e8cc19bd72e23aff339ce02ae0a2c447652ed6f8e82ef4d8294747ebc2

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