Posted on Sep 12th, 2022
🗓️ Today’s Topics
- More about using state in React
- Conditional rendering
- How to make AJAX calls in React using Axios
- The
useEffect
hook
🎯 Project: React Slideshow
This project is due by class time tomorrow.
React Slideshow
📖 Read | 📺 Watch | 🎧 Listen
How to Think About Building Things in React
Props and State
🔖 Resources
AJAX in React
useEffect()
Conditional Rendering and Handling Events
👾 Code
Posted on Sep 12th, 2022
🗓️ Today’s Topics
- Show your finished Habit Tracker
- HTTP requests and responses
- REST APIs
- Django REST Framework (DRF)
🎯 Project: DRF Tutorial
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 is much more beginner-friendly. He also uses pipenv
for the virtual environment like we do. Will’s tutorial stops short of the last step, step 6, in the official tutorial. If you finish step 5 and want to keep going, you can continue with the official tutorial, but this is not required.
You should complete the tutorial by tomorrow. This assignment link generates an empty repo that you can use to push your completed tutorial to.
⛔ Do not copy & paste the code. You’ll get a lot more out of the tutorial if you type it out yourself.
📖 Read | 📺 Watch | 🎧 Listen
ICYMI 👀
These links were posted last week, but you may not have gotten to them.
🔖 Resources
👾 Notes
Posted on Sep 8th, 2022
🗓️ Today’s Topics
- What did you learn from the tutorial(s) you did? First impressions of React?
- Build a small React app together in class
- Components and JSX
- Handling data in React with props and state
🎯 Project: Freeshelf
Today, you’ll start on your first React app without a tutorial. This is due on Monday.
React Freeshelf
🧰 Please be sure to install the React Developer Tools for Chrome.
📖 Read | 📺 Watch | 🎧 Listen
🔖 Resources
React
CSS
We care about the look and feel of the UI, but that doesn’t automatically mean we have to write custom CSS. Sometimes (like now when you are just learning React!) it makes sense to rely on a library for most or all of your styling. There are a range of libraries from the very comprehensive to the very minimal. Here are some lighter-weight ones that you could check out:
🦉 Code and Notes
Posted on Sep 8th, 2022
Today’s Topics
- Interacting with models in the shell
- Queries and more queries
🎯 Project: Still Working on Habit Tracker
Habit Tracker is due on Monday. You can do this! 💪 What do you need to figure out in order to finish it?
📖 Read | 📺 Watch | 🎧 Listen
- Database Design for Beginners This is a talk from RailsConf, which is focused on Ruby on Rails (Rails is a framework for building web applications in Ruby, very similiar to Django). The talk is an excellent introduction to how to think about your data model – that is, the logic that drives the decisions you make about the models in your code and the structure of your database. Please watch it all the way through; even though it uses Ruby examples you should be able to get the gist.
Building APIs
This is prep material for the topic we will begin next week.
🔖 Resources
Using the shell (Django’s interactive REPL, not pipenv shell)
🦄 PRO TIPS
django-debug-toolbar
has a SQL panel that will show you the queries you are running in the view.
- With
shell_plus
, you can see output of all the SQL queries if you run it like this:
python manage.py shell_plus --print-sql
Lookups
Constraints
Aggregate & Annotate
🦉 Code & Notes