Frequently Asked Questions

Here a list of frequently asked questions.

Why the Name?

The name Jinja was chosen because it's the name of a Japanese temple and temple and template share a similar pronunciation.

How fast is it?

I really hate benchmarks especially since they don't reflect much. The performance of a template depends on many factors and you would have to benchmark different engines in differen situations. However Jinja isn't slow. The benchmarks from the testsuite show that Jinja is about twice as fast as Django templates and about three times as slow as mako. That's not bad for a sandboxed template engine that has to sanitize template input on the fly. If you really need the best performance of a template engine consider using mako.

What happened to Jinja < 1?

Before Jinja 1 there was a template engine too with the same name. Beside the name and the same maintainer those two projects don't share a single line of code. If you have an application using Jinja < 1 you should try to make it Jinja 1 compatible. If that's not possible, the old project is still available as 0.9-maint in the old Jinja subversion repository.

Why should I use Jinja?

There are dozens of template engines for Python, many of them try to achieve different things. If you are looking for a XML based template engine have a look at genshi, if you want a bleezing fast template engine with the full range of python constructs have a look at mako. If you want sandboxed templates you probably want to check out Jinja.

Differences to Django

While the Jinja default syntax looks pretty much like Django the rest of the template engine works completely different. Jinja was designed to be used without Django and to support Python expressions.

Features that Jinja has in common with Django

Differences to Django