Skip to content

42cs/flask-webapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flask-webapp

Use Flask To Build a WebApp

Installation

Run the following two commands.

python3 -m pip install lxml python3 -m pip install flask

If you are on windows - you might need to run the lxml installerfrom this link

If that doesn't work for you - Google your error message.

Windows: http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml

Get CalDining Menu Data

We'll have to figure out how to get the menu information from the dining hall website.

Let's navigate to an example menu page for Foothill here

Let's get python to read it.

Open caldining.py and let's figure out how to use lxml to get the data.

Running the webserver

Run this command in your terminal

python3 server.py

You should see something like

* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
* Restarting with stat...

Then open your webbrowser and navigate to http://localhost:5000

Play around with flask

  • Let's create a new route
  • Let's create a route with a parameter

Hookup Flask with our scraper

Make it look better.

Instead of return 'hello'

Let's try return render_template('home.html')

Templates

	<h1> Here's whats avaialble today at {{ name }} </h1>

About

Use Flask To Build a WebApp

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published