How to Create REST APIs for Every Taste with Django OAuth Toolkit
summary
Shows how to build a Time Tracker REST API using Django REST Framework and Django OAuth Toolkit (oauthlib-backed). Implements Activity and TimeEntry models with GET/POST endpoints, replaces DRF authentication with the toolkit’s OAuth2 class, and demonstrates developer app registration, the OAuth2 authorization code flow (client_id/secret, redirect, code exchange), issuance of access and refresh tokens, and using Authorization: Bearer to call protected endpoints; working code will be published on GitHub.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 1:11Why REST APIs with OAuth2
- 3:36REST API backend needs
- 5:25OAuth2 authorization flow
- 9:42Setting up Django REST
- 12:12DRF serializers and views
- 14:03DRF viewsets and browsable API
- 15:06Django OAuth Toolkit setup
- 16:34Live demo
- 18:46Developer app registration
- 19:53Authorization code flow demo
- 21:45Access and refresh tokens
- 22:29Protected API calls
- 23:16Future plans
