O'Reilly logo
live online training icon Live Online training

Building APIs with Django REST Framework

Shauna Gordon-McKeon

APIs are one of the most common ways to let users and third party vendors interact with your site, and with the Django REST Framework they’re easy to make. This training not only teaches you what APIs are and how they work, it will show you how to take your existing site and build a quick and easy API on top of it. Increase the flexibility of your site and the versatility of your skillset with this course.

What you'll learn-and how you can apply it

  • How to convert data from database to HTTP response and back again via serializers
  • Using Django REST Framework’s versatile API Views
  • Customizing DRF’s default views to fit your needs
  • Authenticating and rate-limiting your API’s users

This training course is for you because...

  • You understand how Django works and are comfortable building basic websites with it
  • You want to enhance your websites by allowing users to interact with it programmatically

Prerequisites

  • Comfortable working with Python and Django

Course Setup:

Recommended Preparation:

Recommended Follow-up:

About your instructor

  • Shauna Gordon-McKeon is a technical consultant who specializes in web development. She’s worked with dozens of businesses and non-profits to create websites and other tools to meet their organizational needs. She has a bachelor’s degree in neuroscience and participates in the open science and open source software community.

Schedule

The timeframes are only estimates and may vary according to how the class is progressing

Segment 1: API Basics (50 minutes)

  • Training overview (5 minutes)
  • Django review (5 minutes)
  • Serializers & ModelSerializers (30 minutes)
  • Creating a basic API view & interacting with it from the command line (10 minutes)

Break + Q&A (10 minutes)

Segment 2: Diving into API Views (50 minutes)

  • API actions: get, post, put, delete (10 minutes)
  • Extending an action (15 minutes)
  • Adding a custom action (15 minutes)
  • API ViewSets (10 minutes)

Break + Q&A (10 minutes)

Segment 3: Authentication; Rate-limiting; Nested Relationships (50 minutes)

  • Requiring a login (10 minutes)
  • Object-level permissions (10 minutes)
  • Rate-limiting (15 minutes)
  • Nesting serializers to handle related objects (15 minutes)

Final Q&A (10 minutes)