> Is Jinja2 a practical alternative or there's friction to using it?
jinja2 is drop in by changing the template backend. You can actually run both at the same time (just can't mix them, ofc).
> Is Jinja2 a practical alternative or there's friction to using it?
jinja2 is drop in by changing the template backend. You can actually run both at the same time (just can't mix them, ofc).
It's a practical alternative, but definitely not a drop-in replacement! I've been working on migrating a django project to jinja2 lately, see the diff: https://framagit.org/la-chariotte/la-chariotte/-/merge_reque...
A few notables differences:
- many controls are now functions/variables (that's good!), and some change name, for example `{% csrf_token %}` -> `{{ csrf_input }}`
- calling methods without parenthesis does not work (that's good!), for example `query.all` -> `query.all()`
- in tests` response.context` is replaced by `response.context_data`, which is not set when calling `render` directly (need to return a proper `TemplateResponse`)
- template folders need to be renamed from `templates` to `jinja2`; there may be a way to change this behavior, but i did not find it, and this change is written so small in the docs i lost an entire day over it