Gave up on Datastar
I tried hard to like Datastar—I read docs and articles, watched many YouTube tutorials and interviews with the developers—but I'm giving up. There are some great demos around, but for just swapping DOM elements, HTMX (or Alpine AJAX) are easier to work with.
Also, Datastar has moved features into a "Pro" version that costs US$299! So if you want to update the URL after loading/swapping an element, that will cost you US$299. And from what I can tell (I can't test it), this won't update the browser's history, so the back button gets broken.
Both HTMX and Alpine AJAX can do this. I'm using Alpine AJAX for this in a new project, and it allows you to dynamically load content while updating the URL and the browser's history. Which means you can bookmark or share or refresh the page and use Django's logic to return the full content.