While no support is strictly required to use Brevé with Django, a preliminary attempt at a Django-specific plugin was introduced in 1.0.21 that mimics the current Django template API to make it more natural to use Brevé with Django.
You need to add an import to your Django view:
from breve.plugin.django_adapter import loader, render_to_response
Using this API will require one setting in your Django configuration file:
BREVE_ROOT = '/path/to/templates'
Unlike Django templates, Brevé will not search the TEMPLATE_PATH (although you can change this by using a custom loader).
Note that this plugin was tested against Django SVN (trunk) on 2007/01/08. Other versions may require modification to the plugin.
from django.http import HttpResponse
from breve.plugin.django_adapter import loader
def index ( request ):
t = loader.get_template ( 'index' )
return HttpResponse ( t.render ( { 'foo': 'bar' } ) )
The adapter also supports the slightly shorter idiom:
from django.http import HttpResponse
from breve.plugin.django_adapter import render_to_response
def index ( request ):
return render_to_response ( 'index', { 'foo': 'bar' } )
render_to_string ( ) is supported as well.
I've only done brief testing with Django, although I'm aware of people using Brevé and Django together.
Please report any issues or shortcomings.