Posted on Dec 21st, 2021
๐๏ธ Todayโs Topics
- Project Progress
- File Uploads
๐ Resources
File uploads
POST with upload using Insomnia
For more information on the values for Content-Type
:
CORS for file upload
Assuming you are using django-cors-headers
, youโll need to add the following to settings.py
:
from corsheaders.defaults import default_headers
CORS_ALLOW_HEADERS = list(default_headers) + [
'content-disposition',
]
๐ Read | ๐บ Watch | ๐ง Listen
Posted on Dec 20th, 2021
๐๏ธ Todayโs Topics
How are the projects coming along? ๐
Keep pushing forward! ๐ช ๐
Todayโs class is devoted to getting you past any blockers you may be experiencing and to talk through next steps.
Minimum requirements are listed below for reference.
๐ฏ Project due on Wednesday afternoon
๐ If your project meets minimum requirements today, HUZZAH! That is awesome. You should be working on at least one spicy feature.
๐ If your project does not yet meet minimum requirements, you should shoot for meeting them by the end of the day tomorrow.
All projects
- Users can login, logout, and register
- Auth token is saved in local storage
QuestionBox, Front End
- Any user can see all questions and answers
- A user can post a question; questions cannot be edited (editing can optionally be allowed on unanswered questions)
- A user can post an answer to a question
- A user can mark an answer to a question they posted as โacceptedโ
- A user can see a list of all their own questions and all their own answers
- A user can star/favorite questions or answers
Social Cards, Front End
- Show cards from all users
- A user can see all their own cards
- A user can design and create a new card
- A user can follow another user
- A user can see cards from a user they follow
- A user can see a list of users they follow
๐ Resources
Posted on Dec 20th, 2021
๐น End of Phase Presentations
This week each of you will record a short video screencast on a topic of your choice. The video should be 4-5 minutes long.
Your target audience is a brand new Momentum student who is just at the beginning of Phase 3. Imagine you are teaching them how to do what youโve done in this project. Give them the benefit of your experience over these past several weeks.
This video does not have to be polished, scripted, or edited. But I should be able to follow what youโre saying and understand the points you are making.
I suggest using Loom โ itโs very simple to use for screencasts and for camera videos and will let you share your video easily. The free account also limits your videos to 5 minutes, so it should help you with timing!
Loom lets you record a screencast with or without your face showing. You can choose according to your preference.
Please post your video and share the url for it using this form. Your videos are due by 4:00 pm on Wednesday, Dec 22.
๐ป Back End Guidelines
Your target audience is another beginner developer who is familiar with Django but not with DRF, Postgres, or Heroku. Please pick one of these topics.
- Pick 1-3 endpoints in your application and talk about how you implemented them. Did you make any interesting decisions or customizations along the way? You might touch on at least some of these topics: the url patterns; the HTTP methods that are handled; serializers; permissions; querysets and any filtering you may have done.
- Explain serializers, using examples in your app. Show us the serializer code and explain how it relates to models and how it is used in views. Point out any customizations you made and explain why you made them. Show an example JSON response using Insomnia or the browsable API from DRF.
- What is the most interesting specific feature or technical detail that you implemented for this project? Walk us through its functionality and implementation.
๐ฆ Front End Guidelines
Your target audience is another beginner developer who is familiar with JavaScript but not with React or Netlify. Please pick one of these topics.
- Explain the routing in your app. What urls does your app have? How do you handle navigation from component to component. Give us an overview of React Router and how youโve used it.
- Walk us through one of the components in your app and explain how it works. Topics you might touch on: what the purpose/responsibility of the component is; what component renders it and what props it receives from its parent; any state the component has and what that state is for; any events that component handles; any hooks used in the component besides useState (e.g. useEffect, useRef, useLocalStorageState).
- Build a new teeny tiny React application from scratch and talk us through some of the basics. You can start after creating a new create-react-app application and npm installing all the things; you can start in an App.js that is rendered via an index.js or main.js. Your application should have one component with an input form that echos whatever your user types and displays it on the page in real time. If you want to get fancier than this, you can โ just keep it under 5 minutes.
Posted on Dec 20th, 2021
Todayโs Topics
- Postgres full-text search
- Automatic deploys with Herokuโs GitHub integration
๐ฏ Project due on Wednesday afternoon
๐ If your project meets minimum requirements today, HUZZAH! That is awesome. You should be working on at least one spicy feature.
๐ If your project does not yet meet minimum requirements, you should shoot for meeting them by the end of the day tomorrow.
Note
Depending on how youโve constructed your API, you might have separate endpoints for all of the below, or you might have fewer endpoints (for instance, if you nested answers in the question detail endpoint). What matters is that you have endpoints your front-end team can use to access this data, and they are documented somewhere.
QuestionBox, Back End
- login, logout, and register
- list all questions and answers
- create a question
- create an answer
- mark an answer to own question as โacceptedโ
- list of all questions and all answers for an authenticated user
- star/favorite questions or answers
Social Cards, Back End
- login, logout, and register
- list all cards
- list all cards for a user you follow
- list all cards for an authenticated user
- create a new card
- follow/unfollow another user
- list all users an authenticated user follows
๐ Read | ๐บ Watch | ๐ง Listen
๐ Resources
@action
decorator in ViewSets
Filtering and search
๐ฆ Code & Notes
- DRF Library API
- Notes on Django Queries These are the same notes you may have seen at the beginning of the Phase. Iโm including them here for easy reference, as they show examples of queries and filters that might come in handy for search endpoints.
Posted on Dec 16th, 2021
Todayโs topics
- React Router โญ v6
- Using local storage with state to store an auth token
๐ฏ Project
Continue planning with your team on tackling the Questionbox or Social Ecards projects. By Friday, you should be able to make requests for questions and answers if you are working on Questionbox or make requests for getting or creating cards. Deploy to Netlify as soon as possible (Tip ๐ก: Your code needs to run locally with no errors before you can deploy it!).
๐ Read | ๐บ Watch | ๐ง Listen
โ ๏ธ These two resources are for older versions of React Router, so you will see some outdated syntax. For instance Switch
, Redirect
, and the component
prop on Route
exist only in versions of React Router earlier than version 6. However, the main concepts are the same, so these resources can still help you understand the context and usage of React Router.
๐ Resources
๐ฆ Code