CS1999 Tech notes
Notes to explain how to do (and understand) project tasks.
Especially for phase 0
For task 0-RUN:
- using virtual environments
- using localhost (or: why isn't 0.0.0.0 working?)
Things that are useful from the start
Your buggy editor is a webserver...
Debugging tips:
- use print()
- “error in update operation” or problems saving to the database
General set-up:
Adding comments to your code:
- comments in Python and HTML... and more
Especially for phase 1
Notes for task 1-TEMPLATE: Add a new template to the app:
- templates in Flask (where the HTML comes from)
- routes in Flask (how it picks the right template)
Notes for task 1-ADD: Add more data to the form:
- identify the template to edit
- add input tag to the form
- handle the POST request
- know what's in the database
- add new data: CREATE TABLE
- add new data: ALTER TABLE
More general things for once you've got going
Notes to overcome CSS not changing when you hit refresh (may help with 1-STYLE):
Notes for using Flask's flash messages:
- setting a secret key (also: how cookies work)
- flash messages
How to add images to your Flask app: