Re:Show HN: Askama – Type-safe, compiled Jinja-like template...
by orf on Thursday March 09, 2017 @01:13PM
(#13831431)
Jinja yes, django not so much.
[ Parent
| on HN ]
Re:Show HN: Askama – Type-safe, compiled Jinja-like template...
by strig on Thursday March 09, 2017 @01:29PM
(#13831630)
It's essentially the same syntax
Re:Show HN: Askama – Type-safe, compiled Jinja-like template...
by orf on Thursday March 09, 2017 @01:37PM
(#13831723)
Kind of but not really, Jinja let's you do a lot more. {{(x or y)|filter(z)}} for example, or even just {{function(a, b, c)}}.
Django is far more restrictive in what you can put between the braces. I think one of the design goals of it was that designers with little programming knowledge could write the templates, which is a noble idea but leads to frustration as anyone who has maintained a large django app will tell you.
Re:Show HN: Askama – Type-safe, compiled Jinja-like template...
by benwilber0 on Thursday March 09, 2017 @03:43PM
(#13833397)
I think part of the motivation for the limitations was to stop people from putting too much business logic in their templates. You can of course implement any kind of tag or filter you want and just use that. Or indeed just use Jinja if you want. Django's templates are perfectly fine and I still prefer them over the similar alternatives.