Skip to Content
Django RESTful Web Services
book

Django RESTful Web Services

by Gastón C. Hillar
January 2018
Intermediate to advanced
326 pages
7h 38m
English
Packt Publishing
Content preview from Django RESTful Web Services

Working with class-based views

We will write our RESTful Web Service by coding class-based views. We will take advantage of a set of generic views that we can use as our base classes for our class-based views to reduce the required code to the minimum and reuse the behavior that has been generalized in the Django REST framework.

We will create subclasses of the two following generic class views declared in the rest_framework.generics module:

  • ListCreateAPIView: This class view implements the get method that retrieves a listing of a queryset and the post method that creates a model instance
  • RetrieveUpdateDestroyAPIView: This class view implements the get, delete, put, and patch methods to retrieve, delete, completely update, or partially update ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Building Versatile Mobile Apps with Python and REST: RESTful Web Services with Django and React

Building Versatile Mobile Apps with Python and REST: RESTful Web Services with Django and React

Art Yudin

Publisher Resources

ISBN: 9781788833929Supplemental Content