A lot of times it's either through Nextjs/Nuxtjs + Django as an API or complex bundling process which requires a file where you register bundle versions/manifests then another build process which embeds them into template
both are so complex
A lot of times it's either through Nextjs/Nuxtjs + Django as an API or complex bundling process which requires a file where you register bundle versions/manifests then another build process which embeds them into template
both are so complex
If you want to build an SPA anyway, then Django is not the right framework to start with though.
What is the right framework for building SPAs?
For example, there is a nice component library, shadcn, of course you can somehow embed it into the project, but to use it productively, you must have a bundler, which is outside of Django ecosystem.
Also, if you take a look at AI generated content, a lot of them are optimized for outputting JS for frontend, try embedding it in Django project, its non-trivial
At my day job we use Django with HTMX and Alpine, but we also generate the custom CSS from Pico[1] and use JinjaX[2] to define server-side components which we then render in Storybook. We use Vue as our bundler to compile the JS and CSS as well as to run Storybook. The project has to live in both the Python ecosystem and the Node.js ecosystem.
Even with just HTMX and Alpine you might want to compile a custom version of those with certain plugins, or you might want to load them as libraries in your own scripts.
[0] https://storybook.js.org/ [1] https://picocss.com/ [2] https://jinjax.scaletti.dev/