Replies: 3 comments
-
Have you read the summary at: |
Beta Was this translation helpful? Give feedback.
-
@cclauss Yes, I read it. That's exactly what made me think that DRF doesn't provide any new feature that Django already provides, but I'm also not super familiar with Django, hence my questions. The "Web browsable API" feature is unclear. Maybe that's something that could be useful that doesn't exist in Django? The other addition may be that there are more authentication options? I'm just guessing. I wonder why isn't this just part of Django itself, if that's the case. |
Beta Was this translation helpful? Give feedback.
-
DRF is basically a django app. In my opinion, what DRF essentially does is that it makes it easy to implement serialization, viewsets, authentication, permissions, etc. in a WEB API fashion on top of Django Core. So, to answer your question in my opinion..
As I said above, I would say that anything that makes it easy to implement a number of API-friendly features is a benefit of DRF: throttling, token backend, a large ecosystem for API documentation, request payload validation, etc.
My guess is that if you try to implement the tutorial APIs in the official documentation without using DRF, you'll get a good idea of what DRF offers. I haven't tried it, but I'm almost certain that if you need to do any maintenance to modify or add functionality to the API after the code is complete, it makes more sense to use DRF. I hope that answers your question :) I personally think that DRF has become the standard for Django WEB API development... |
Beta Was this translation helpful? Give feedback.
-
I suppose many people asked this question in the past, but I'd like to get an up-to-date answer, which applies to the latest versions of DRF and Django (2023-2024).
I understand that the DRF is used to build APIs, but doesn't Django already provide that, i.e. ways to create views and return JSON or any other types of responses, like HTML?
Similarly, afaik, plain Django already includes serialisers and an authentication mechanism.
So, in summary, is there feature that the Django REST framework provides that plain Django doesn't?
If not, what are the subjective advantages of using DRF over plain Django?
Basically, I'd like to know if
I'd like to see code examples that show how DRF is better than plain Django.
I see many people use DRF, but I don't really understand why, because Django already has serialisers and an authentication mechanism, as far as I understand.
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions