logoalt Hacker News

stevexyesterday at 10:11 PM2 repliesview on HN

Django + AlpineJS + HTMX is pretty nice.


Replies

HiPhishyesterday at 11:54 PM

That's just for the HTML content though. What if you want to add some non-trivial Javascript or generated CSS? Or maybe you want to integrate a frontend tool like Storybook[0] even if your HTML is rendered server-side? Maybe add some tests for your frontend code? There is much more between raw hand-rolled HTML/CSS/JS and a full-blown SPA.

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/

show 1 reply
FartinMowleryesterday at 10:26 PM

Especially with template partials now in the core of Django 6.