The reason you’re getting the error is because of this:
I think I understand what you’re trying to do here, you’re trying to generate a different hx-get attribute for each entry of the select list - but that’s not going to work this way. The template is being rendered by Django, but you’re not going to know what ID was selected until a selection is made - and that happens in the browser.
(What’s actually happening here is that that attribute is not being rendered by the rendering engine when that field is being rendered - notice that the url is the literal text supplied in the attribute. You can verify this by examining the HTML that was rendered to the browser. This means that this way of approaching it isn’t going to work for two separate and distinct reasons.)
What I do for situations like this is wrap the select field in a div, and put the hx-get on that div, along with using the hx-params attribute to include the field value as a GET parameter.
It’s not as “clean” as using the url parameters, but it works. (Which means there may be a better solution, but if there is, I’m not aware of it. I’m sure you could probably build something based on handling the configRequest event, but I’m not immediately convinced that would be “better”.)
Note: Also see Possibility to pass some parameters as path variables instead of in query string · Issue #1202 · bigskysoftware/htmx · GitHub - This appears to be related.