Podcast
Questions and Answers
What is the primary software requirement mentioned for completing the mini project?
What is the primary software requirement mentioned for completing the mini project?
Which folder is referred to as the root folder of the application?
Which folder is referred to as the root folder of the application?
What command should be run in the terminal to enter the virtual environment?
What command should be run in the terminal to enter the virtual environment?
Where can you find instructions for the mini project in the file structure?
Where can you find instructions for the mini project in the file structure?
Signup and view all the answers
What command should you run to install the packages listed in the Pipfile?
What command should you run to install the packages listed in the Pipfile?
Signup and view all the answers
What framework is utilized for creating the web app in this mini project?
What framework is utilized for creating the web app in this mini project?
Signup and view all the answers
What should you do if you encounter a message about adding pipenv to the PATH?
What should you do if you encounter a message about adding pipenv to the PATH?
Signup and view all the answers
How do you exit the virtual environment at the end of a session?
How do you exit the virtual environment at the end of a session?
Signup and view all the answers
What should be done after modifying the mergesort() function in serverlibrary.py?
What should be done after modifying the mergesort() function in serverlibrary.py?
Signup and view all the answers
Which file contains the definition for the db object needed for the application?
Which file contains the definition for the db object needed for the application?
Signup and view all the answers
What is the role of the routes.py file in the application?
What is the role of the routes.py file in the application?
Signup and view all the answers
What should be done in the templates folder for Exercise 1?
What should be done in the templates folder for Exercise 1?
Signup and view all the answers
How can you check if the target folder was created successfully after compiling clientlibrary.py?
How can you check if the target folder was created successfully after compiling clientlibrary.py?
Signup and view all the answers
Which command is necessary to run the web application after setting up the database?
Which command is necessary to run the web application after setting up the database?
Signup and view all the answers
What is the expected output when the users are displayed in the web application?
What is the expected output when the users are displayed in the web application?
Signup and view all the answers
What programming language is used to implement the EvaluateExpression and Stack classes?
What programming language is used to implement the EvaluateExpression and Stack classes?
Signup and view all the answers
In what specific form should the users be shown in users.html?
In what specific form should the users be shown in users.html?
Signup and view all the answers
What command is used to stop the web application that is running?
What command is used to stop the web application that is running?
Signup and view all the answers
Study Notes
Mini Project 2 - Web App Development (Math Quiz)
- Project Goal: Develop a web application for integer arithmetic quizzes.
- Prerequisites: Git installation.
-
Project Setup:
- Clone the repository:
git clone <repo URL>
- Navigate to the
mp_calc
folder for this mini-project. - Install
pipenv
: (Windows/Linux commands provided) - Add
pipenv
to PATH (if needed for Vocareum Linux shell): (Command provided). - Install packages specified in
Pipfile
usingpipenv install
. - Activate virtual environment:
pipenv shell
(or prepend commands withpipenv run
) - Verify virtualenv activation: Check for
(mp_calc)
in your prompt - Terminate virtual environment:
exit
- Clone the repository:
Application Structure and Files
-
Key Files:
application.py
,app/__init__.py
,app/routes.py
,templates/users.html
,serverlibrary.py
,clientlibrary.py
-
application.py
: Contains Flask application setup. Note the differences from previous mini-projects. -
__init__.py
: Contains database (db
) object creation and importsroutes.py
. -
routes.py
: Defines URL routing for the app, particularly the/
route. -
users.html
: Displays user data in a table format. Jinja templating used for dynamic content.
Exercise 1: Displaying User Data
-
Objective: Display user data within the
users.html
table. - Tools: Jinja templating.
-
Implementation: Replace placeholders (
#Replace Me#
) inusers.html
to iterate over users and display relevant details. -
Dependencies: Complete Exercise Q1 in
mp2_exercises.ipynb
and incorporate merged sort intoserverlibrary.py
.
Exercise 2: Server Library Implementation
-
Objective: Implement classes in
serverlibrary.py
. -
Classes:
Stack
,EvaluateExpression
. -
Testing:
- Test functions in
serverlibrary.py
using example inputs (as provided). - Verify correct output is displayed and table functionality is correct.
- Test functions in
Client Javascript Library
-
Compilation: Compile
clientlibrary.py
(located inapp/static/
) using Transcrypt.- Navigate to
app/static/
in your terminal - Run
transcrypt clientlibrary.py
- Navigate to
-
Database Setup: Create the
app.db
database file and any required migrations.
Application Deployment and Running
- Database Preparation: (Commands provided).
-
Flask Run:
- Navigate to the root directory.
- Run Flask: (Commands provided)
-
Browser Access: Open
http://127.0.0.1:5000/
in your web browser to view the app. -
Stopping the App: Press
Ctrl+C
to stop the Flask server. - Vocareum Specifics (if applicable): Follow additional instructions specific for Vocareum if needed.
Mini Project Outcomes
-
Expected output: Output examples, including sorted user data (
users.html
) and calculations (EvaluateExpression
) are given. -
Error Handling: Handle any errors appropriately in your
serverlibrary.py
andapplication.py
files.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Description
This project focuses on developing a web application aimed at conducting integer arithmetic quizzes. It requires the use of Git for setup and involves various Python files to establish the application framework using Flask.