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:
- the design , implementation of jinja2 seemed more intuitive me, both software developer , template designer;
- jinja2 more extensible (at least in ways i've sought extend template engine);
- jinja2 more flexible in terms of permitting logic-code run (but gives enough rope hang with);
- 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);
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
Post a Comment