Re:Django, HTMX and Alpine.js: Modern websites, JavaScript o...
by rojoca on Tuesday November 23, 2021 @06:17PM
(#29324803)
Haven't used django for a year or 2 but used to use django-rest-framework's negotiation to get both json and html responses (was using inertiajs not htmx) and it worked pretty well. You can use decorators on the api methods to set things like templates. Here's an example:
This can return JSON or HTML with the data injected.
[ Parent
| on HN ]
There are no comments on this comment yet.