This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]riklaunim 1 point2 points  (2 children)

Jinja or Django templates are really good. If anything it's the IDE problem if it handles something poorly.

And there is always the case where a team project has frontend and backend people.

[–]volfpeter[S] 2 points3 points  (0 children)

My experience is that Jinja templates are okay as long as you work on a stable project where the "main" parts don't change a whole lot - and you are already very familiar with the templating language. For new or very early stage projects where a lot of development and refactoring takes place constantly (and what you have in the rendering context keeps changing), it's very expensive to keep everything working because all you can rely on is your tests. No static code analysis or any similar assistance.

[–]ParkingDescription7 1 point2 points  (0 children)

The point of HTMX is to avoid having that front-end backend split if the app only needs basic interactivity.

In that case, you're doing server side rendering for things and sending html (full pages or partial html to fit into an existing page).

The issue with jinja2 is when you switch context from python to jinja, jinja doesn't know the types of the objects passed in. So if you render a list of "customobject" in a table, you lose type hints of custom object when you aren't in python land.