Tom Christie wrote this about what DRF brings to the table over plain Django:

Django REST framework isn't required, but it helps you get a lot of things 
right that will be time consuming and error prone if you're working from core 
Django.
 • Serializers
The Django serializers are not really suitable for anything other than dumping 
and loading fixture data - they don't allow you to customize the representation 
in any substantial way.
Using Django Forms for validation isn't suitable either as they're intended for 
HTML only validation and can't eg handle nested validation.
REST frameworks serializers are designed for API usage and cover both JSON or 
form validation, as well as being able to represent as either HTML Forms or 
formats such as JSON. They also give you lots of scope for handling the 
representation of relationships, such as using hyperlinked relations.
 • Authentication and permissions
REST framework's authentication will gracefully handle both session based and 
token based schemes at the same time, and get the CSRF behavior right. You'll 
find that really awkward to do if using plain Django. It also helps ensure 
you're issuing failure responses that are suitable for API clients (eg get 401 
vs 403 responses right)
The auth, permissions and throttling are also more flexible because they're 
defined at a view level, rather than as middleware or a view decorator. This 
makes it easier to eg combine multiple schemes, or to apply different schemes 
to different parts of your application.
 • Views
Django's generic class based views are suitable to HTML applications. REST 
framework's generic class based views are suitable for API services. Typicallly 
API views have slightly different behavior by convention. Eg create in an HTML 
application might typically redirect the user to the created item, whereas an 
API will respond with a 201 CREATED response.
There's stacks of other functionality and behavior that makes using Django REST 
framework simpler, quicker and likely more correct than if you start with plain 
Django. But those are some of the obvious differences to get started with.

https://reddit.com/r/django/comments/3h9oj8/_/cu5pzu9/?context=1

Seems pretty concise and self explanatory to me. This could easily be adapted 
to be in the docs.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/af24d69f-1d16-40db-9558-11745fce2399%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to