3 ms·
Django/Jinja/Stencil should be the de facto standard for all templating systems so developers can port their work to any platform without sweat. Kudos for port
by Entangled 10y ago
Django/Jinja/Stencil should be the de facto standard for all templating systems so developers can port their work to any platform without sweat.
Kudos for porting Jinja to Rust.
- orf 10y agoJinja yes, django not so much.
- strig 10y agoIt'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 :(
- dochtman 10y agoTo be honest, there have been multiple takes on Jinja in Rust already; I think Tera (https://github.com/Keats/tera https://github.com/Keats/tera) is the most used. However, Tera didn't quite feel Rusty to me, so I wanted to try another approach.