Tuesday, November 14, 2017

Bottle App

Bottle App

This week I will be creating a Bottle app.  Bottle is great for a number of things including prototyping ideas, learning how web frameworks are built, and running personal or simple web apps. Bottle is contained within a single large source file called bottle.py that makes it easier to get the app up and running as well as read and see how Bottle framework interacts with the web application code. *Please click on the photos to enlarge them

Getting Started

The first thing I did was go to the web tab and create a new bottle app:
I will be using the same domain name that I have been previously using jpernick.pythonanywhere.com.  Next, I saved and ran a script to create a todo.db database file as well as a table in which I will store the items of the todo list.  This is what the script looks like:
I have also decided to store the code for this in a file called todo.py.  This is what the file tree looks like after running the script:
Next I updated code to include the route jpernick.pythonanywhere.com/todo,  this is the code:
Next week I will be implementing a template as well.  As always thank you for reading and please write me any comments or questions you may have.  
-Joe

No comments:

Post a Comment