We don't just want to look at our tasks in our Web view. We want to change those tasks, too. To do that, we'll add input fields to our Web view for information about a task to be added. (We'll get around to deleting and changing them, too.)
This means we need to know about:
It's remarkably easy to mess something up here! Good software engineering comes in handy. Here the mantra that popped to my mind is: "Make the change easy, then make the easy change."
So, let's add no new functionality and just distinguish between GET and POST in
main.py. My approach here was:
This makes the upcoming change a lot easier, especially if you're less fluent in HTTP and HTML.
Next post: Python task manager from scratch, part 20: Adding a form