Render a template into a response.
(template_name, **context)
| 60 | |
| 61 | |
| 62 | def render_template(template_name, **context): |
| 63 | """Render a template into a response.""" |
| 64 | tmpl = jinja_env.get_template(template_name) |
| 65 | context["url_for"] = url_for |
| 66 | return Response(tmpl.render(context), mimetype="text/html") |
| 67 | |
| 68 | |
| 69 | def nl2p(s): |