I don't know Flask or Django, so I don't know how to answer that.
In any case, you can get a long way already with htmx using any backend technology that allows to return html (snippets). There is an interesting post at
https://htmx.org/essays/when-to-use-hypermedia/#hypermedia-not-a-good-fit-if that explains more when htmx might not be a good fit for your project.