Momentum logo
Team 12 Classroom

🐻 Django REST Framework 🐻

Posted on May 24th, 2022

πŸ—“οΈ Today’s Topics

Today we dive into Django REST Framework. 🀿

🎯 Project: Choose Your Own Adventure πŸͺ 🐫

Choose one of the following options.

The application must be deployed to Heroku, whichever option you choose. πŸš€


πŸͺ OPTION ONE: Add an API to Habit Tracker

Add a new app to your existing Habit Tracker project and call it api. Your app should provide CRUD endpoints that return JSON responses.

By Friday afternoon, you should be able to do the following via the API – that is, by making requests using Insomnia.

  • list habits
  • create a new habit
  • view a habit
  • update a habit
  • delete a habit

By Monday, you should be able to complete all CRUD tasks through the API:

  • list habits
  • create a new habit
  • view a habit
  • update a habit
  • delete a habit
  • list records for a habit (this should be on the habit detail API endpoint)
  • create a record for a habit for today (stretch: create a record for any date)
  • update a record for a habit
  • delete a record from a habit

Write up a list of endpoints you think you will need before you start doing this!

You should develop and test your endpoints using Insomnia. (You can also use the browsable API that DRF gives you in the browser, but you should be comfortable using Insomnia.)

🐫 OPTION TWO: Django Library API

Link to assignment invitation.

Create a new API-only application that lets users keep track of books they are reading, want to read, or have read, and take private or public notes on books.

You should not make forms or templates for this app, but you will need models, urls, views, and serializers. You should use class-based views and return JSON responses.


πŸ“– Read | πŸ“Ί Watch | 🎧 Listen

πŸ”– Resources

Blog articles that go with Lacey Williams Henschel’s talk

πŸ¦‰ Code

Back to home