def render_template(template_name, **context):
 tmpl = jinja_env.get_template(template_name)
 context['url_for'] = url_for
 return Response(tmpl.render(context), mimetype='text/html')

def render_template ( template_name , ** context ) : tmpl = jinja_env . get_template ( template_name ) context [ 'url_for' ] = url_for return Response ( tmpl . render ( context ) , mimetype = 'text/html' )
renders a template from the template folder with the given context .