On Feb 3, 2006, at 1:34 PM, Ben Bangert wrote: > # setup the myghty engine > from myghty.wsgi import engine > myghtyengine = engine(template_root='/some/path/to/templates') > > # render a template > def render_myghty(template): > environ['wti-source'] = template > environ['wti-vars'] = myvars > environ['wsgi.application_root'] = environ['SCRIPT_NAME'] > environ['SCRIPT_NAME'] += environ['PATH_INFO'] > environ['PATH_INFO'] = '' > return myghtyengine(environ, start_response)
Thought I'd ammend this. Since the engine would implement the Template Spec, it'd do what it needs to inside, so a realistic example would be: # render a template environ['wti-source'] = template environ['wti-vars'] = myvars return myghtyengine(environ, start_response) And of course the implementation details of how it plays with environ are left up to it. Someone who wanted something even easier could just have a wrapper on that call in their framework, etc. Cheers, Ben _______________________________________________ Web-SIG mailing list Web-SIG@python.org Web SIG: http://www.python.org/sigs/web-sig Unsubscribe: http://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com