This is a simple Flask web application created for training and demonstration purposes. It showcases basic routing, template rendering, static file serving, and form handling in Flask.
flask_demo/
│
├── app.py
├── requirements.txt
├── static/
│ └── style.css
└── templates/
├── about.html
└── index.html
- app.py: Main application file containing Flask routes and logic.
- requirements.txt: Lists required Python packages.
- static/style.css: Stylesheet for the web pages.
- templates/index.html: Home page template with a feedback form.
- templates/about.html: About page template.
- Demonstrate basic Flask features:
- Routing (
/,/about,/feedback) - HTML template rendering
- Serving static files
- Handling form submissions
- Routing (
- Home Page: Welcome message and a feedback form.
- About Page: Information about the app.
- Feedback Submission: Displays a thank you message with submitted feedback.
Download or clone the repository to your local machine.
Ensure you have Python 3.7+ installed. You can download it from python.org.
Create and activate a virtual environment to isolate dependencies:
On Windows:
python -m venv venv
venv\Scripts\activateOn macOS/Linux:
python3 -m venv venv
source venv/bin/activateNavigate to the project directory and install dependencies using pip:
pip install -r requirements.txtStart the Flask development server:
python app.pyThe app will run on http://localhost:5000.
- Home page: http://localhost:5000/
- About page: http://localhost:5000/about
On the home page, fill out the feedback form and submit. Your name and message will be displayed as a thank you response.
https://www.loom.com/share/c65d848b1a3f457e9e8b9ab510fe75f5?sid=49123e48-35cb-4210-98d5-55ffddc99faa