Skip to content
The Jinja2 template engine
Branch: master
Clone or download
Latest commit fd89fed Apr 6, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
artwork documentation style updates, added print css May 6, 2008
docs Fix typo Feb 8, 2019
examples change py2 print statements to py3 Mar 22, 2015
ext Trim trailing white space throughout the project Aug 30, 2018
jinja2 Merge branch '2.10.x' Apr 6, 2019
scripts Trim trailing white space throughout the project Aug 30, 2018
tests Merge branch '2.10.x' Apr 6, 2019
.coveragerc standard test configuration Jul 6, 2017
.gitignore Add .pytest_cache/ to gitignore Mar 19, 2018
.travis.yml Add testing and document support for Python 3.7 & pypy3 Dec 8, 2018
AUTHORS
CHANGES.rst Merge branch '2.10.x' Apr 6, 2019
LICENSE Fixed inconsistency in LICENSE file. Jan 6, 2009
MANIFEST.in clean up MANIFEST.in Nov 8, 2017
Makefile Switch to short traceback Dec 28, 2016
README.rst In documentation, prefer https over http when available Apr 9, 2017
setup.cfg standard test configuration Jul 6, 2017
setup.py
tox.ini Add testing and document support for Python 3.7 & pypy3 Dec 8, 2018

README.rst

Jinja2

Jinja2 is a template engine written in pure Python. It provides a Django inspired non-XML syntax but supports inline expressions and an optional sandboxed environment.

Nutshell

Here a small example of a Jinja template:

{% extends 'base.html' %}
{% block title %}Memberlist{% endblock %}
{% block content %}
  <ul>
  {% for user in users %}
    <li><a href="{{ user.url }}">{{ user.username }}</a></li>
  {% endfor %}
  </ul>
{% endblock %}

Philosophy

Application logic is for the controller, but don't make the template designer's life difficult by restricting functionality too much.

For more information visit the new Jinja2 webpage and documentation.

The Jinja2 tip is installable via pip with pip install https://github.com/pallets/jinja/zipball/master.

Builds

master https://travis-ci.org/pallets/jinja.svg?branch=master
2.9-maintenance https://travis-ci.org/pallets/jinja.svg?branch=2.9-maintenance
You can’t perform that action at this time.