Templating Options

TurboGears has a very simple and flexible template system located at tg.render. Which is a tiny wrapper around pylons.templating to provide dotted template lookup support.

Built in renderers

We currently support the following template engines out of the box.

All you need to do to use any one of these template engines is to add it to the list of renderers to prepare in app_cfg.py:


and then specify that you want to use that particular engine in the @expose declaration:

def foo(self, *args, **kwargs)

We have docs on some of the specifics of each of these template engines:

Writing your own render function


Difficulty: Medium. Document writing your own render function for templates