Guidelines:
This homework will be submitted using a Git repository. The Git repo should contain a
folder called uni-final, all lowercase. A link to the Git repo should be submitted to
Courseworks.
Flask
Up to this point, we’ve been primarily focusing on utilizing Python to manipulate data using various classes and libraries. Python is also useful for a variety of other applications, including creating a back end for web applications. A backend is essentially a series of routes that direct both users and data to and from various pages on a website. We can create such a backend using Flask, a Python microframework.
A basic Flask server has the ability to “serve” different webpages, depending on what a user
has requested. This is also often referred to as the client-server model where a client (i.e. a
user), requests information that is displayed by a server. In this assignment, we’ll be creating
a basic server with Flask that will allow a user to traverse through the pages of a simple
website.
Getting Started
Although web applications are usually developed with IDEs such as Visual Studios, we will
be using Spyder to remain consistent with the rest of the course. The skeleton code contains
a folder called “final”. Rename this folder to uni-final. Open the app.py file provided in the
skeleton code. Read the comments in the code to make sure you get what’s happening. More
information about Flask will also be provided in recitation. Upon running the app.py file,
you should get a message similar to this:
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
30 | 31 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 1 | 2 | 3 |
Get Free Quote!
445 Experts Online