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.
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 %}
Application logic is for the controller; however, try not to make life painful for the template designer due to not enough functionality.
For more information visit the new Jinja2 webpage and documentation.
The Jinja2 tip is installable via easy_install with easy_install Jinja2==dev
.
master |
|
2.7-maintenance |