Tuesday 10:30 a.m.–11 a.m.

Django REST API - So easy you can learn it in 25 minutes

Nina Zakharenko

Audience level:

Novice

Description

Django REST Framework can make creating a RESTFUL api quick and easy.

Join me as I go over: - What makes an API Restful - How Serializers can make representing your existing models in JSON a breeze - What the built in Views provide for you, and how to provide authentication for your API - How to route to your new Endpoints - Last but not least, how to Unit Test them

Abstract

Django REST API - So easy you can learn it in 25 minutes

Let’s rewind, what makes an API Restful?
  • What is REST
  • What are HTTP Verbs
  • URL structure
  • Idempotency
Serializers
  • Non model serializers
  • Using model serializers for the least amount of work
  • Representing models and model relationships
Views
  • Using your serializers in the view
  • Class based vs. Method based views
  • What do you get from extending the framework provided views
  • Specifying which HTTP verbs your API provides, and then implementing them
  • Permissions and authentication
  • Documenting your views
Routing
  • How to define your new endpoints in urls.py
  • How to link these endpoints to your views
  • Specifying which keys (primary and foreign) will be passed in from a URL
Browsable API
  • Using the Browsable API to view and POST to your endpoints
Unit Testing
  • How to unit test your new endpoints