Skip to main content

Mako template support for cherrypy.

Project description

Mako template support for cherrypy.

Installation

pip install marbaloo_mako

Usage

# templates/dir1/index.mak
<h1>Today: ${today}</h1>
# app.py
import os
import marbaloo_mako
from datetime import date
cherrypy.tools.mako = marbaloo_mako.Tool()

class Root(object):
    @cherrypy.expose
    @cherrypy.tools.mako(filename='/index.mak')
    def simple(self):
        return  {'today': date.today()}

root_path = os.path.dirname(__file__)
cherrypy.quickstart(Root(), '/', {
                            '/': {
                                'tools.mako.on': True,
                                'tools.mako.directories': [os.path.join(root_path, 'templates/dir1')]
                            }
                        })

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for marbaloo_mako, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size marbaloo_mako-0.1.0.tar.gz (2.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page