Armin Ronacher | d6a2003 | 2010-10-17 16:30:15 +0200 | [diff] [blame] | 1 | Welcome to Jinja2 |
| 2 | ================= |
Armin Ronacher | 083ae16 | 2008-04-27 21:42:57 +0200 | [diff] [blame] | 3 | |
Carl A Dunham | d546358 | 2014-01-18 15:26:10 -0600 | [diff] [blame] | 4 | Jinja2 is a modern and designer-friendly templating language for Python, |
Armin Ronacher | d6a2003 | 2010-10-17 16:30:15 +0200 | [diff] [blame] | 5 | modelled after Django's templates. It is fast, widely used and secure |
| 6 | with the optional sandboxed template execution environment: |
| 7 | |
| 8 | .. sourcecode:: html+jinja |
| 9 | |
| 10 | <title>{% block title %}{% endblock %}</title> |
| 11 | <ul> |
| 12 | {% for user in users %} |
| 13 | <li><a href="{{ user.url }}">{{ user.username }}</a></li> |
| 14 | {% endfor %} |
| 15 | </ul> |
| 16 | |
| 17 | **Features:** |
| 18 | |
| 19 | - sandboxed execution |
| 20 | - powerful automatic HTML escaping system for XSS prevention |
| 21 | - template inheritance |
| 22 | - compiles down to the optimal python code just in time |
Carl A Dunham | d546358 | 2014-01-18 15:26:10 -0600 | [diff] [blame] | 23 | - optional ahead-of-time template compilation |
Armin Ronacher | d6a2003 | 2010-10-17 16:30:15 +0200 | [diff] [blame] | 24 | - easy to debug. Line numbers of exceptions directly point to |
| 25 | the correct line in the template. |
| 26 | - configurable syntax |
| 27 | |
Armin Ronacher | 89f61fd | 2011-02-06 12:19:30 +0100 | [diff] [blame] | 28 | .. include:: contents.rst.inc |
Armin Ronacher | 9d472df | 2008-05-04 19:56:34 +0200 | [diff] [blame] | 29 | |
Armin Ronacher | ed98cac | 2008-05-07 08:42:11 +0200 | [diff] [blame] | 30 | If you can't find the information you're looking for, have a look at the |
jmoore | cd95414 | 2011-12-14 17:09:29 +0100 | [diff] [blame] | 31 | index or try to find it using the search function: |
Armin Ronacher | ed98cac | 2008-05-07 08:42:11 +0200 | [diff] [blame] | 32 | |
Armin Ronacher | 9d472df | 2008-05-04 19:56:34 +0200 | [diff] [blame] | 33 | * :ref:`genindex` |
Armin Ronacher | ed98cac | 2008-05-07 08:42:11 +0200 | [diff] [blame] | 34 | * :ref:`search` |