4 ms·
It's essentially the same syntax
by strig 10y ago
It's essentially the same syntax
- orf 10y agoKind 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.
- benwilber0 10y agoI 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.
- orf 10y agoYeah, I understand the motivation but it doesn't help when you just want to call a model method with just a single argument. They are also dog slow :(