GOALS

(source: https://bottlepy.org/)

At the end of this tutorial, we will have a simple, web-based ToDo list. The list contains a text (with max 100 characters) and a status (0 for closed, 1 for open) for each item. Through the web-based user interface, open items can be view and edited and new items can be added. 

During development, all pages will be available on localhost only, but later on it will be shown how to adapt the application for a “real” server, including how to use with Apache’s mod_wsgi. 

Bottle will do the routing and format the output, with the help of templates. The items of the list will be stored inside a SQLite database. Reading and writing the database will be done by Python code.

 We will end up with an application with the following pages and functionality:

  • start page http://localhost:8080/todo
  • adding new items to the list: http://localhost:8080/new
  • page for editing items: http://localhost:8080/edit/<no:int>
  • catching errors