First time here? Check out the FAQ!
1

Why does askbot use Jinja?

What is the reason that Askbot switched to the Jinja templating system? To my understanding, Jinja is based off the Django template system, but does not support template tags (without massive headache), which most third-party Django apps use. For example, I'm trying to integrate sorl-thumbnails, whose main API is a template tag ("thumbnail"), and I have to figure out a way to to manually render the tag first, before inflating the template. I already had to do this for my personal apps, which is highly annoying.

theactiveactor's avatar
167
theactiveactor
asked 2012-07-14 15:32:01 -0600
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

1

Jinja2 templates are a lot faster - that's mainly why. I've rewritten templates in Jinja2 and got at least 5x speedup of rendering.

It is a pain to integrate django template tags into Jinja2, I think it will be easier to rewrite some tags as Jinja2 macros.

Evgeny's avatar
13.2k
Evgeny
answered 2012-07-14 19:15:22 -0600
edit flag offensive 0 remove flag delete link

Comments

2

Why did Instagram choose Jinja2 instead of Django Templates?

At the time, it was simply more flexible than the built-in tempting language (inline python). In our initial experience it was also much (much) faster. However, I believe in recent releases of Django they’ve addressed many of these differences, so I’m not sure we’d necessarily use Jinja2 from the start today. http://www.forbes.com/sites/limyunghui/2012/04/09/inspiring-insights-by-instagram-ceo-kevin-systrom-the-man-who-built-a-1-billion-startup/2/ .. just found this link..

pcompassion's avatar pcompassion (2013-08-15 05:51:06 -0600) edit

This is a pity. I'd happily trade a little bit of rendering speed if it makes askbot integratable. As it is now, askbot would force us to use jinja. We have a HUGE ecosystem of apps all using the django templating system. So it's not an option to switch. And we don't see a real speed benefit either, because template rendering is usually a tiny part of what takes time to render a request anyway. IMHO If askbot wants to be "integratable into existing django projects", it should switch to django templates.

stefanfoulis's avatar stefanfoulis (2014-04-23 01:29:33 -0600) edit
add a comment see more comments