pyramid-breve

  203 downloads
0.6.2 MIT/X Consortium License    
  not rated
Breve template engine renderer add-on for Pyramid

description

download

specifications

pyramid-breve is an extension for the pyramid framework that allowes users to use the Breve templates as view renderers.

Usage

Call config.include('pyramid_breve') in your WSGI applicatication factory function as following:

def main(global_config, **settings):
 """ This is just an example of how to register renderer for Breve templates.
 """
 config = Configurator(settings=settings)

 config.include('pyramid_breve')

 config.add_static_view('static', 'static', cache_max_age=3600)
 config.scan()

 return config.make_wsgi_app()


Another way is to add it to pyramid.includes in your INI-file:

[app:main]
use = egg:hello_world

pyramid.includes =
 pyramid_breve


Please note that unlike breve.Template which searches for template files under root pyramid_breve renderer uses assets to locate and load templates.

@view_config(route_name='home', renderer='templates/index.b')
def hove_vew(request):
 return {}


@view_config(route_name='login', renderer='my.lovely.package:templates/login.b')
def login_view(request):
 return {}
READ MORE   
Last updated on September 21st, 2012

0 User reviews so far.

SUBMIT