Jinja

Framework Integration

Navigation

Contents

Jinja registers itself in the baker template plugin system. If your framework supports baker (currently TurboGears and pylons) you can add it very easily.

Pylons

Edit yourproject/config/middleware.py and add the following lines to config.init_app...:

from jinja import Environment, FileSystemLoader

config.add_template_engine('jinja', {
    'jinja.environment': Environment(loader=FileSystemLoader('path/to/templates'))
})

To make Jinja the default template engine change the init_app call to something like this:

config.init_app(global_conf, app_conf, package='yourproject',
                template_engine='jinja')