Skip to content

HTMX and jinja templates in single app #3426

Answered by JacobCoffee
Murtagy asked this question in Q&A
Discussion options

You must be logged in to vote

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 HTMXTemplate

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)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Murtagy
Comment options

Answer selected by Murtagy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants