Momentum logo
Team 7 Classroom

๐Ÿ Django REST Framework ๐Ÿ

Posted on Mar 25th, 2021

Todayโ€™s Topics

Today we are going to dive into the Django REST Framework.

๐ŸŽฏ Project

Add an API to Habit Tracker. (note: There is no assignment repo or README for this.)

Add a new app to your existing Habit Tracker project and call it api. By the end of the week, your app should provide CRUD endpoints in JSON.

By Friday afternoon, you should be able to list, create, update, and delete habits.

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 (on the habit detail API endpoint)
  • create a record for a habit
  • update a record for a habit
  • delete a record from a habit

You should develop and test your endpoints using Insomnia. (If you want to change it up you can also play with another popular tool for building and testing APIs called Postman).

Your application should be deployed to Heroku.

๐Ÿ“– Read | ๐Ÿ“บ Watch | ๐ŸŽง Listen

๐Ÿ”– Resources

Blog articles that go with Lacey Williams Henschelโ€™s talk

๐ŸฆŠ Multiple components + conditional rendering ๐ŸฆŠ

Posted on Mar 23rd, 2021

Today is focused on using multiple components and conditional rendering to create multiple views of your application.

๐ŸŽฏ Project

Continue React Trivia. For Thursday, make your trivia categories selectable. When selected, you should show at least 10 questions for that category. If you can, go ahead and show answers and perhaps even make them selectable.

๐Ÿ”– Resources

๐Ÿ REST APIs and Django ๐Ÿ

Posted on Mar 22nd, 2021

Todayโ€™s Topics

  • Habit Tracker progress reports
  • Lightning talks
    • Lookup expressions with .filter()
    • Lookups that span relationships
    • Complex lookups with Q
    • Related objects
    • Aggregate & Annotate
  • HTTP requests and responses
  • REST and the Django REST Framework

๐ŸŽฏ Project

Complete the official Django REST Framework tutorial. You may find it easier going if you follow the guide by Will Vincent.

Will Vincent uses the exact same code and steps, but takes more time to explain what is going on and uses the django admin interface instead of the shell to create objects in the database. Willโ€™s tutorial stops short of the last step, step 6, in the official tutorial. But if you finish step 5 and want to keep going, you can continue with the official tutorial.

You should complete the tutorial by tomorrow afternoon.

Some tips about the DRF Tutorial to keep in mind:

  • Do not copy & paste the code. Youโ€™ll get a lot more out of it if you type it out yourself.
  • Donโ€™t use the Momentum Django Project Template. The custom user model in that template conflicts with the tutorial.

๐Ÿ“– Read | ๐Ÿ“บ Watch | ๐ŸŽง Listen

๐Ÿ”– Resources

๐ŸฆŠ Front-end: React Component Props & State ๐ŸฆŠ

Posted on Mar 18th, 2021

Todayโ€™s Topics

  • What did you think of the tutorial(s) you did? Impressions of React?
  • Build a small React app together in class
  • Components and JSX
  • Handling data in React with props and state

๐ŸŽฏ Do

Today, youโ€™ll start on your first React app without a tutorial. This is due on Monday.

React Freeshelf

๐Ÿ“– Read | ๐Ÿ“บ Watch | ๐ŸŽง Listen

๐Ÿ”– Resources

๐Ÿ‘จโ€๐Ÿ’ป Code Examples

๐ŸŽฅ Video

๐Ÿงถ Loom screencasts

I made some short topic videos walking through doing some more stuff with the DevsForHire app.