4 ms·
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 validatio
by devwastaken 5y ago
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.
- fixmycode 5y agoI think the only real option here would be DRF, it's a very mature library to switch Django from website builder to API backend
- tedmiston 5y agoAgreed, Django + DRF provides everything you need for this use case out of the box.
- phn 5y agoThat would be django-rest-framework.
- JshWright 5y agoThat'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.
- tedmiston 5y agoI 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.
- uyaij 5y agoI'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/ https://django-ninja.rest-framework.com/