1
# -*- coding: utf-8 -*-
6
Jinja2 is a template engine written in pure Python. It provides a
7
Django inspired non-XML syntax but supports inline expressions and
8
an optional sandboxed environment.
13
Here a small example of a Jinja2 template::
15
{% extends 'base.html' %}
16
{% block title %}Memberlist{% endblock %}
19
{% for user in users %}
20
<li><a href="{{ user.url }}">{{ user.username }}</a></li>
26
:copyright: (c) 2010 by the Jinja Team.
27
:license: BSD, see LICENSE for more details.
29
__docformat__ = 'restructuredtext en'
32
# high level interface
33
from jinja2.environment import Environment, Template
36
from jinja2.loaders import BaseLoader, FileSystemLoader, PackageLoader, \
37
DictLoader, FunctionLoader, PrefixLoader, ChoiceLoader, \
41
from jinja2.bccache import BytecodeCache, FileSystemBytecodeCache, \
42
MemcachedBytecodeCache
45
from jinja2.runtime import Undefined, DebugUndefined, StrictUndefined
48
from jinja2.exceptions import TemplateError, UndefinedError, \
49
TemplateNotFound, TemplatesNotFound, TemplateSyntaxError, \
50
TemplateAssertionError
52
# decorators and public utilities
53
from jinja2.filters import environmentfilter, contextfilter, \
55
from jinja2.utils import Markup, escape, clear_caches, \
56
environmentfunction, evalcontextfunction, contextfunction, \
60
'Environment', 'Template', 'BaseLoader', 'FileSystemLoader',
61
'PackageLoader', 'DictLoader', 'FunctionLoader', 'PrefixLoader',
62
'ChoiceLoader', 'BytecodeCache', 'FileSystemBytecodeCache',
63
'MemcachedBytecodeCache', 'Undefined', 'DebugUndefined',
64
'StrictUndefined', 'TemplateError', 'UndefinedError', 'TemplateNotFound',
65
'TemplatesNotFound', 'TemplateSyntaxError', 'TemplateAssertionError',
66
'ModuleLoader', 'environmentfilter', 'contextfilter', 'Markup', 'escape',
67
'environmentfunction', 'contextfunction', 'clear_caches', 'is_undefined',
68
'evalcontextfilter', 'evalcontextfunction'