Week 9 (Flask)

Topics

  • Flask
  • Databases

Programmming Exercises

In this week, it can be a good idea to focus less on brief exercises and more so on building a larger application, step-by-step! For example, the Birthdays lab offers a good application to build together as a class, touching on all of HTML, CSS, JavaScript, Flask, and databases along the way.

Discussion Questions

One technique to promote participation in class is a quick, 2–3 minute discussion question. Letting students posit their own reasoning, even if they’re not entirely sure of an answer, can help reinforce material from lecture. One model for introducing these questions is the “Think, Pair, Share” approach, in which students take 30 seconds to think of their own answer and 60 seconds to share their answer with a partner. Afterwards, you can call on random pairs to share their thinking with the larger group. It’s also best to follow up with your own answer, too!

  • What’s the difference between the GET and POST methods of an HTTP request? When might you use POST instead of GET? GET instead of POST?
  • Looking at the files that make up a web application, including—for example—index.html, styles.css, app.py, and application.db, which files correspond to the application’s view? Its controller? Its model?

Annotated Sample Slides

Here you’ll find sample slides to adopt or adapt when teaching Week 9.

Some slides contain speaker notes to illustrate why the sample slides take a certain approach to illustrating a concept or leading an exercise. You’re welcome to modify these slides as you see fit, though do try to keep some of the same elements of active learning that have been included in these samples.

Past versions of sample slides are also available under the “Additional Slide Resources” dropdown.