summaryrefslogtreecommitdiff
path: root/examples/bench.py
diff options
context:
space:
mode:
authorArmin Ronacher <armin.ronacher@active-4.com>2010-06-05 14:31:27 +0200
committerArmin Ronacher <armin.ronacher@active-4.com>2010-06-05 14:31:27 +0200
commitf60232d52b71555e48b6c799f01e512cffa7429c (patch)
treeb8cf852b3a4c8da16db64acc30204f4304fea951 /examples/bench.py
parent53cafcc1aead95a5373bdecaabc18a2a432b7631 (diff)
downloadjinja2-f60232d52b71555e48b6c799f01e512cffa7429c.tar.gz
Updated examples to use Django cached.
--HG-- branch : trunk
Diffstat (limited to 'examples/bench.py')
-rw-r--r--examples/bench.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/examples/bench.py b/examples/bench.py
index 0d5a68f..ab3d4b0 100644
--- a/examples/bench.py
+++ b/examples/bench.py
@@ -103,7 +103,7 @@ try:
except ImportError:
test_django = None
else:
- django_template = """\
+ django_template = DjangoTemplate("""\
<!doctype html>
<html>
<head>
@@ -131,16 +131,13 @@ else:
</div>
</body>
</html>\
-"""
+""")
def test_django():
c = DjangoContext(context)
c['navigation'] = [('index.html', 'Index'), ('downloads.html', 'Downloads'),
('products.html', 'Products')]
- # recompile template each rendering because that's what django
- # is doing in normal situations too. Django is not thread safe
- # so we can't cache it in regular apps either.
- DjangoTemplate(django_template).render(c)
+ django_template.render(c)
try:
from mako.template import Template as MakoTemplate