[Web-SIG] A trivial template API counter-proposal

Guido van Rossum guido at python.org
Sat Feb 4 17:17:54 CET 2006

> API to be provided by a "template engine":
> compile_string(text), compile_stream(input_stream) - return a WSGI
> application object for the template described by the text or file-like object
> write_compiled(app, output_stream) - save the compiled form of the template
> to output_stream
> read_compiled(input_stream) - read a template from input_stream and return
> a WSGI application object

I am probably missing something, but shouldn't there also be an API to
render the template to a string or stream given some context of
variable names? I'm looking at this from a very different perspective,
namely *using* various templating engines from an app that otherwise
doesn't use a framework but still needs templating.

(PS having tried WSGI a bit now I'm fine with it. Perhaps wsgiref
should go into the Python 2.5 standard library?)

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Web-SIG mailing list