News for hackers. Stuff that matters.
Re:The Decline of Django by devwastaken on Friday October 15, 2021 @09:13AM (#28877322)
If I were to have a Django backend and only be serving Json responses, what combination of methods/libraries are commonly used for that? Such as input validation, client side request sending, etc.
Re:The Decline of Django by fixmycode on Friday October 15, 2021 @09:18AM (#28877374)
I think the only real option here would be DRF, it's a very mature library to switch Django from website builder to API backend
Re:The Decline of Django by tedmiston on Friday October 15, 2021 @10:34AM (#28878098)
Agreed, Django + DRF provides everything you need for this use case out of the box.
Re:The Decline of Django by JshWright on Friday October 15, 2021 @09:33AM (#28877497)
That's probably not the right use case for Django (I say this as someone who defaults to Django for new projects unless there's a compelling reason not to).

Something like FastAPI would be better suited to a narrow use case like that, as that's what it specializes in.

Re:The Decline of Django by tedmiston on Friday October 15, 2021 @10:36AM (#28878121)
I would also prefer to use FastAPI [with Pydantic models] for something like this today too. That said, this is Django + DRF's bread and butter, even if the framework itself is a little dated these days.
Re:The Decline of Django by phn on Friday October 15, 2021 @09:22AM (#28877405)
That would be django-rest-framework.
Re:The Decline of Django by uyaij on Friday October 15, 2021 @10:19AM (#28877946)
I've recently started using Django Ninja at work, and I really like the FastAPI-like request/response schema handling.

[1] https://django-ninja.rest-framework.com/