CherryPy example ================ This describes a short example of how to best use Templess in combination with `CherryPy`_, a simple but versatile web framework. The tips here can be applied to all systems, although CherryPy has the advantage of being able to serve generator-based functions (where the result of the generator is streamed to the client), which Templess provides hooks for. In systems that don't allow this, 't.generate(self.get_context())' will have to be replaced with something like 't.unicode(self.get_context())'. The code -------- Here's a simple example that uses this principle in an 'hello, world' fashion, in 'real life' situations obviously the context will be a lot larger, however, the 'index' method (that actually serves the data) can be quite similar. Contents of 'index.html' (placed in the CherryPy application directory)::