[Solved]-Django Rest Framework or JsonResponse

7👍

Django Rest Framework includes a lot of tools that JsonResponse doesn’t have.

JsonResponse is to Django Rest Framework as Flask is to Django. You can do all the things you want with JsonResponse, but DRF gives you a lot of tools to automate many tasks, where JsonResponse would require you to manually do all those things.

Edit to clarify:
DRF somewhat mirrors Django’s functionality. For instance, to validate data, you can do this in the serializer class in DRF, much like you would validate data in the form class in base Django. You can automagically create serializers from models in DRF by using ModelSerializer classes, which is much like Django’s generic views.

On the home page of DRF, the very top explains much of what DRF does, including links to examples and explanations:

Django Rest Framework

👤PoDuck

Leave a comment