HTMX and jinja templates in single app #3426
-
I want some my endpoints to respond with full pages, while others to support partial content updates with htmx. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You want regular, full Jinja routes and then partial HTMX routes? Basically for your full templates you would just return a HTMX is not its own templating engine, but can be used with any we provide or any custom ones (as you can see in my partial HTMX HTML file, it also uses Jinja to fill in some blanks) |
Beta Was this translation helpful? Give feedback.
You want regular, full Jinja routes and then partial HTMX routes?
You can see https://github.com/JacobCoffee/niapi/tree/main/app/domain/web/templates for a crude example that uses both
Basically for your full templates you would just return a
Template
but for the partials you want to do via HTMX you would return an HTMXTemplateHTMX is not its own templating engine, but can be used with any we provide or any custom ones (as you can see in my partial HTMX HTML file, it also uses Jinja to fill in some blanks)