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
import cherrypy
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.

Source Distribution

marbaloo_mako-0.1.1.tar.gz (2.9 kB view details)

Uploaded Source

File details

Details for the file marbaloo_mako-0.1.1.tar.gz.

File metadata

File hashes

Hashes for marbaloo_mako-0.1.1.tar.gz
Algorithm Hash digest
SHA256 94b7e0b6ad7d237ea3692427d892471bc380b645ca54f0e245f1988a50c762f8
MD5 c0dd53f2fcd67ba21df0e35769a6e8b5
BLAKE2b-256 21190d58137509b51dad0bc852afbbad7a4c68e3fc72452d39d885559bc7128d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page