DRF

the CRUD is not enough

things about me

Lead Engineer

Organizer

@raiderrobert 

twitter | github | medium

ACTION HTTP VERB
CREATE POST
READ GET
UPDATE PUT, PATCH
DELETE DELETE

these verbs map well to:

  • Create a blog post
  • Read a timeline
  • Update my user profile
  • Delete a friend request

/blog/

GET

POST

/blog/1

GET

PUT/PATCH

DELETE

but what about these:

  • a weather forecast
  • book a hotel room
  • request a loan rate
  • sync user session

GET

POST

PUT

PATCH

DELETE

a weather forecast

which verb?

GET /forecast/29601-US/hourly

GET /forecast/29601-US/?period=hourly

GET /forecast/hourly?id=29601,US

GET /forecast?id=29601,US&period=hourly

a weather forecast

which route?

let's not give up so easily

there's rarely one right answer

DEMO

DRF - the CRUD is not enough

By Robert Roskam

DRF - the CRUD is not enough

A short intro into how api frameworks such as Django REST Framework let you do other more than just Create, Read, Update, and Delete. And how one might design these actions.

  • 192