django-genshi is a small wrapper library around Genshi that provides an API similar to django.template . Included are imitations of Context and RequestContext . There is also an implemention of the Django template loader system adapted for Genshi, and a selection of shortcut functions.

Usage

See the Django [1] and Genshi [2] documentation for detailed usage notes. The API of django-genshi is intended to mirror that of Django, while writing or manipulating the templates will require knowledge of Genshi.

Genshi cannot use Django’s default template loaders – to work around this, the app_directories , filesystem , and eggs loaders have been modified and included in the django_genshi.loaders package. Modify your TEMPLATE_LOADERS accordingly.

Example:

>>> from django_genshi import render_to_response >>> response = render_to_response ('template_name.xml', {"name": "world"}) >>> print response.content <h1>Hello world!</h1>