liveBook · Manning

Django REST Framework

As explained in Django in Action

Django REST Framework is a Django library for building web APIs, including request handling, serialization, and representation of application data.

Django REST Framework (DRF) is a feature-rich Django library for building web APIs. It uses classes instead of simple functions, with methods for GET, POST, and other HTTP actions. Its broader control comes with more code than newer alternatives such as Django Ninja. section 11.3

A typical DRF API combines:

  • Class-based handlers that correspond to HTTP actions. section 11.3
  • Serialization classes for converting application or Django ORM objects into API data. section 11.3
  • Authentication mechanisms supplied by the framework. section 11.3
  • Renderer classes that control response formats and also power the interactive web interface. section 11.3

Beyond JSON

A DRF endpoint can switch response output from JSON to XML through configuration, or export YAML generated from nested serializers. Its renderer ecosystem also includes HTML forms, Django templates, and third-party formats such as CSV and Excel. section 11.3

How Django in Action covers it

How deep it goes
Explains class-based actions, serialization, ORM mapping, authentication, and renderers, without detailing a complete implementation.
Examples
Uses interactive API testing, JSON-to-XML configuration, nested YAML serializers, and renderer-based HTML or template responses.
What it assumes
Assumes a Django project context and introduces API construction through Django-compatible classes and libraries.
What you can do after
Build Django APIs with class-based actions, serializers, authentication, and configurable response formats.
How it connects
Connects Django with HTTP actions, serialization, the Django ORM, authentication, renderers, JSON, XML, and Django Ninja.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Django in Action. The section links point to the parts of the book it draws on.