Django: Switching to Jinja2? -


i've got couple small (500 or 600 lines of template code) django sites, , i'd migrate them using jinja2… i'd idea of how work be. so, in general, how work migrate small django site jinja2? , “worth it”?

while it's own experience, found converting django jinja2 worthwhile following reasons:

  1. the design , implementation of jinja2 seemed more intuitive me, both software developer , template designer;
  2. jinja2 more extensible (at least in ways i've sought extend template engine);
  3. jinja2 more flexible in terms of permitting logic-code run (but gives enough rope hang with);
  4. jinja2 regarded faster (though haven't done benchmarks, subject debate depending on tests used, , in event largely irrelevant in total wait time query has db lookups);
  5. jinja2 gives more helpful error output django (i.e. traces line number in template error occurred). edit: according dor's comment, django gives helpful error messages point line , context of problem, jinja2.

if haven't had trouble django's template engine, jinja2's should feel relatively intuitive, if perhaps bit more polished (or did me, @ rate). well, found coffin project written , reasonably helpful when converting django jinja2 – both use, , example of how extend jinja2.

all being said, django's template engine solid , quite capable tasks. believe it's being improved in next revision of django, , there quite lot of effort add capabilities quite number of dedicated developers. result there no worries of becoming unsupported in near medium-term future.

again, that's experience, it's worth – hope that's helpful.


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -