Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


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


Agreed, Django + DRF provides everything you need for this use case out of the box.


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.


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.


That would be django-rest-framework.


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/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: