12. Building a REST API

Overview

This chapter introduces REST APIs and Django REST Framework (DRF). You will start by implementing a simple API for the Bookr project. Next, you will learn about the serialization of model instances, which is a key step in delivering data to the frontend side of Django applications. You will explore different types of API views, including both functional and class-based types. By the end of this chapter, you will be able to implement custom API endpoints, including simple authentication.

Introduction

In the previous chapter, we learned about templates and class-based views. These concepts greatly help expand the range of functionalities we can provide to the user on the frontend (that is, in their web browser). ...

Get Web Development with Django now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.