Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
The Jinja2 template engine
Python HTML Other

Merge pull request #472 from pydanny/pydanny-update-django-switch-docs

Remove conditions segment of Django section
latest commit 50c6cd7f39
@untitaker untitaker authored

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 easy_install with easy_install Jinja2==dev.

Builds

master https://travis-ci.org/mitsuhiko/jinja2.svg?branch=master
2.7-maintenance https://travis-ci.org/mitsuhiko/jinja2.svg?branch=2.7-maintenance
Something went wrong with that request. Please try again.