Mako renderer for lribeiro.cherrypy.templating
Project description
Mako renderer for lribeiro.cherrypy.templating
It has two optional config entries:
templating.mako.template_directories: can be a path to the templates directory, absolute (with leading slash) or relative to the root module location, or a list of paths. If none is given, {root directory}/templates is used.
templating.mako.config: any additional arguments to be passed to the TemplateLookup constructor
Developed under Python3.4 and tested against Python2.7, Python3.4 and pypy.
Usage:
import cherrypy
from lribeiro.cherrypy.templating import template
from lribeiro.cherrypy.templating.mako import renderer
class Root(object):
@cherrypy.expose
@template('index.html')
def index(self):
return {'context': 'variables'}
@cherrypy.expose
@template('/page.html')
def page(self):
return {'context': 'variables'}
config = {
'/': {
'templating.renderer': renderer,
'templating.mako.template_directories': 'mako_templates', # optional
'templating.mako.config': {'module_directory': '/tmp/modules'} # also optional
}
}
if __name__ == '__main__':
cherrypy.quickstart(Root(), '/', config)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for lribeiro.cherrypy.templating.mako-1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8b2a04104e69d1cf03ace4e7c21c762437e8cda398b2e9909e99c0c0f5836f5 |
|
MD5 | b8f323026b6c2ab185f8f00ece1aef22 |
|
BLAKE2b-256 | 48848967e9d0d5e0191f9523649e78b8a3534b3f4271bba67303d1fcb41a1b62 |
Close
Hashes for lribeiro.cherrypy.templating.mako-1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50b4e2f560279978c41dd26e37c7f799b82787d8c3bd72902e3d43d2fa4df865 |
|
MD5 | da0009ed969204cfe97d952d7170eb82 |
|
BLAKE2b-256 | 7c641aeb09e8a7be586f74434a561d200465753bdb44ecdd773a2224514aa3d6 |