## To use this example:
# curl -d '{"name": "John Doe"}' localhost:8000

from sanic import Sanic
from sanic import response
from jinja2 import Template

template = Template('Hello {{ name }}!')

app = Sanic(__name__)

@app.route('/')
async def test(request):
    data = request.json
    return response.html(template.render(**data))


app.run(host="0.0.0.0", port=8080, debug=True)
@@ -1,220 +1,545 @@
-#
 # 
-To use this example:%0A# curl -d '%7B%22name%22: %22John Doe%22%7D' localhost:8000%0A%0Afrom sanic import Sanic%0Afrom sanic import response%0Afrom jinja2 import Template%0A%0Atemplate = Template('Hello %7B%7B name %7D%7D!')%0A%0Aapp = Sanic(__name__)
+Render templates in a Flask like way from a %22template%22 directory in the project%0A%0Afrom sanic import Sanic%0Afrom sanic import response%0Afrom jinja2 import Evironment, PackageLoader, select_autoescape%0A%0Aapp = Sanic(__name__)%0A%0A# Load the template environment with async support%0Atemplate_env = Environment(%0A    loader=jinja2.PackageLoader('yourapplication', 'templates'),%0A    autoescape=jinja2.select_autoescape(%5B'html', 'xml'%5D),%0A    enable_async=True%0A)%0A%0A# Load the template from file%0Atemplate = template_env.get_template(%22example_template.html%22)%0A
 %0A%0A@a
@@ -611,27 +611,32 @@
   re
-turn response.html(
+ndered_template = await 
 temp
@@ -650,16 +650,22 @@
 nder
+_async
 (**data)
 )%0A%0A%0A
@@ -660,16 +660,59 @@
 (**data)
+%0A    return response.html(rendered_template
 )%0A%0A%0Aapp.

Use render_async and a template env with jinja2