view examples/cherrypy/index.py @ 636:699601cce3cc trunk

Follow-up to [751]: applying the optimization to text templates was actually slowing them down, so only do it for markup templates.
author cmlenz
date Wed, 05 Sep 2007 13:06:59 +0000
parents 406915754870
children
line wrap: on
line source
import os
import sys

import cherrypy
from genshi.template import TemplateLoader

loader = TemplateLoader([os.path.dirname(os.path.abspath(__file__))])


class Example(object):

    @cherrypy.expose
    def index(self):
        tmpl = loader.load('index.html')
        return tmpl.generate(name='world').render('xhtml')


if __name__ == '__main__':
    cherrypy.quickstart(Example(), config='config.txt')
Copyright (C) 2012-2017 Edgewall Software