5/5 – (1 vote)
📚 Learning Outcomes
- Create a simple Flask application with multiple routes
- Scrape and parse data from a single web page
- Store and manipulate data within a DataFrame
- Print a DataFrame object to a webpage
💻 Program Specifications
Follow along with the Lab 12 demonstration. The demo program is a collaborative effort between Garth Johnson and Emily Marasco, and is used with permission. Before submitting your files, you must complete the following tasks:
- Change STUDENT NAME to your own name in the code.
- Follow the /hello/ route by entering your own name. Take a screenshot of the display.
- Modify the book table to display a new column with the sale price (reduced by 25%). Submit a screenshot of the modified table being displayed.
- Create a new route /learn that displays one thing that you learned in ENSF 592. Submit a screenshot of your answer being displayed.
- Your submitted code must match your provided screenshots.
- Your code will be run by the instructor/TAs as your end user.
- FAQs about the assignment will be answered in Lab 12 and on the D2L discussion boards. Please check the boards for any clarifications before submitting.
- The grading rubric will be posted to D2L.
To run your web application: MAC/Linux
- Make sure you are working in the correct directory
export FLASK_ENV=developmentexport FLASK_APP=web_data_app.pyflask run
Windows
- Make sure you are working in the correct directory
set FLASK_ENV=developmentset FLASK_APP=web_data_app.pyflask run
Exporting the FLASK_ENV as development enables some nice features that you can explore later on (see Visual Studios Run the App Debugger page for more info on how to setup/use it from within VS), and disables some anoying reminders to NOT use this in production without a proper WSGI (or similar interface).
Once the application is running, browse the local system on port 5000 (typically http://localhost:5000/). When you do, you should see the friendly message Hello World! in your browser and the following in the terminal where the application is running: flask run * Serving Flask app webdataapp.py (lazy loading) * Environment: development * Debug mode: on * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) * Restarting with stat * Debugger is active! * Debugger PIN: 290-425-530 127.0.0.1 [25/Apr/2021 12:04:00] GET / HTTP/1.1 200 127.0.0.1 [25/Apr/2021 12:04:01] GET /favicon.ico HTTP/1.1 404
If you followed the ENSF 592 installation guidelines, you should have all the necessary modules ready to go. If you encounter issues, run the requirements file using pip install -r requirements.txt to ensure you have the correct versions necessary. Make sure you are in your assignment working directory and your ENSF 592 virtual environment.
📝 Assignment Tasks
- If you werent able to attend the June 15th lab, be sure to watch the recording and follow along.
- Clone this repository to your local computer.
- Open VSCode and start a new terminal. Make sure that your
ensf592environment is activated. web_data_app.pyis provided as a starting point. Add your name to the header.- Remember to test your program execution via the terminal:
run flask - Fulfill the tasks above and upload the successful execution screenshots to your assignment repository.
- Commit your screenshots and code.
- Push your local git history to github:
git push origin main - Submit your repository HTTPS link to the Assignment 6 D2L dropbox.
- Tip: If you want to learn more about a specific aspect of Python or Flask, remember to take a look at the official documentation!

![[Solved] ENSF592- Assignment 6](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip.jpg)

![[Solved] ENSF592 Assignment 4](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip-1200x1200.jpg)
Reviews
There are no reviews yet.