Skip to content
Discussion options

You must be logged in to vote

Hi @pwtail ,

There are multiple solutions for that:

  • My favorite is to use one of the htmx request headers, like Hx-Trigger or Hx-Target, that are automatically set by htmx when sending a request according to your hx-trigger and hx-target attributes, and that can be parsed by your Django view (even more easily with django-htmx) in order to decide which template to render
  • Another one is to render the whole page every time and select the relevant fragment on client-side with hx-select. This sounds suboptimal but sometimes it helps, especially if splitting your Django templates requires a big amount of work
  • Yet another approach is to use distinct URLs for each component ; this might be a lit…

Replies: 1 comment 1 reply

Comment options

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

Answer selected by pwtail
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