From ba808266f10831b597625f31574262b3bac18d02 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Fri, 9 May 2008 14:38:09 +0200 Subject: [PATCH] removed wsgi and django from the integration page, wsgi is not interesting and there is no django support module currently. pylons is now documented. --HG-- branch : trunk --- docs/integration.rst | 27 +++++++++++++++++++-------- ext/Vim/jinja.vim | 1 + 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/docs/integration.rst b/docs/integration.rst index 02dacef..64620f7 100644 --- a/docs/integration.rst +++ b/docs/integration.rst @@ -40,20 +40,31 @@ automatically. .. _mapping file: http://babel.edgewall.org/wiki/Documentation/messages.html#extraction-method-mapping-and-configuration -Django +Pylons ------ -TODO +With `Pylons`_ 0.9.7 onwards it's incredible easy to integrate Jinja into a +Pylons powered application. -Pylons ------- +The template engine is configured in `config/environment.py`. The configuration +for Jinja2 looks something like that:: + + from jinja2 import Environment, PackageLoader + config['pylons.app_globals'].jinja_env = Environment( + loader=PackageLoader('yourapplication', 'templates') + ) + +After that you can render Jinja templates by using the `render_jinja` function +from the `pylons.templating` module. -TODO +Additionally it's a good idea to set the Pylons' `c` object into strict mode. +Per default any attribute to not existing attributes on the `c` object return +an empty string and not an undefined object. To change this just use this +snippet and add it into your `config/environment.py`:: -WSGI ----- + config['pylons.strict_c'] = True -TODO +.. _Pylons: http://www.pylonshq.com/ TextMate -------- diff --git a/ext/Vim/jinja.vim b/ext/Vim/jinja.vim index b961653..7704e3a 100644 --- a/ext/Vim/jinja.vim +++ b/ext/Vim/jinja.vim @@ -2,6 +2,7 @@ " Language: Jinja template " Maintainer: Armin Ronacher " Last Change: 2008 May 9 +" Version: 1.1 " " Known Bugs: " because of odd limitations dicts and the modulo operator -- 2.26.2