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

Uploaded Source

Built Distribution

Jinja2-3.1.2-py3-none-any.whl (133.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: Jinja2-3.1.2.tar.gz
  • Upload date:
  • Size: 268.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for Jinja2-3.1.2.tar.gz
Algorithm Hash digest
SHA256 31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852
MD5 d31148abd89c1df1cdb077a55db27d02
BLAKE2b-256 7aff75c28576a1d900e87eb6335b063fab47a8ef3c8b4d88524c4bf78f670cce

See more details on using hashes here.

File details

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

File metadata

  • Download URL: Jinja2-3.1.2-py3-none-any.whl
  • Upload date:
  • Size: 133.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for Jinja2-3.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61
MD5 00ccdb509d3592cc2163b286177d75c8
BLAKE2b-256 bcc3f068337a370801f372f2f8f6bad74a5c140f6fda3d9de154052708dd3c65

See more details on using hashes here.

Supported by

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