equal
deleted
inserted
replaced
53 except : |
53 except : |
54 raise TemplateError("Template broken: %r" % (path, ), status='500 Internal Server Error', details=exceptions.text_error_template().render()) |
54 raise TemplateError("Template broken: %r" % (path, ), status='500 Internal Server Error', details=exceptions.text_error_template().render()) |
55 |
55 |
56 def render_template (tpl, **params) : |
56 def render_template (tpl, **params) : |
57 """ |
57 """ |
58 Render the given template, returning the output, or raising a TemplateError |
58 Render the given template, returning the output as a unicode string, or raising a TemplateError |
59 """ |
59 """ |
60 |
60 |
61 try : |
61 try : |
62 return tpl.render(**params) |
62 return tpl.render_unicode(**params) |
63 |
63 |
64 # a template may render other templates |
64 # a template may render other templates |
65 except TemplateError : |
65 except TemplateError : |
66 raise |
66 raise |
67 |
67 |