On Day 7, we transitioned to backend web development by diving into Flask—a lightweight Python web framework. We mapped how Flask serves as a bridge between the frontend HTML interfaces we built yesterday and the Python logic we learned in Week 1.

1. Flask Basics & Routing

We began by setting up basic Flask application environments, understanding the @app.route decorator, and launching local dev servers. We visualized the client-server relationship, comparing it to a restaurant where Flask acts as the waiter routing orders from the menu (HTML) to the kitchen (Python code).

2. Templates and Forms

To serve real web pages, we utilized the render_template function to connect our Flask backend to an index.html file in a templates folder. We then integrated HTML forms with POST requests, capturing user string inputs via the request object and passing them back to the frontend using Jinja templating tags ({{ message }}).

3. The Hugging Face Account & The 120k LOC Gap

A defining moment occurred when Rashmi announced we would use open-source models via Hugging Face. While my classmates struggled merely to create a Hugging Face account, I recalled opening mine years prior in 2024. Furthermore, when the class was overwhelmed by writing a 120-line Flask script, I silently reflected on having maintained projects scaling to 120,000 lines of code. This massive disparity validated my GOATed path: traditional learning paces at 100 lines, while true engineering scales exponentially.

Key Learnings

  • Instantiating local Flask server environments and declaring URL routes.
  • Serving HTML frontends dynamically using render_template functions.
  • Capturing and parsing user inputs from HTML forms using HTTP POST and the request object.
  • Recognizing the vast practical gap between beginner cohorts and production-level developers.

Tools & Stack

  • Flask
  • Python 3.11
  • HTML Forms
  • Hugging Face

Challenges Overcome

  • Debugging Method Not Allowed (405) errors when forgetting to explicitly allow POST methods on routes.
  • Ensuring Jinja template variables safely matched the arguments passed from the backend.

Task to be Performed

  • Create a local Flask application serving an index route.
  • Construct an HTML template with a form and a submit button.
  • Connect the HTML form to Flask to process user inputs and return them to the screen.

Related Logs

Day 00

Onboarding & Exploration: Mapping the Core AI & Python Blueprint

Onboarding at Virtual Height, introducing the training program, providing an overview of the curriculum, and mapping the 2-week schedule.

May 29, 20264 min readRead Log
Day 01

Day 01: Foundations of AI, Python Lab, and the Velocity of Domain Mastery

Onboarding under Senior AI Trainer Rashmi, mapping the formal pillars of AI from ML to DL, mastering cross-platform Python execution, and demonstrating custom LLM and reverse engineering portfolios to the cohort.

Jun 01, 20264 min readRead Log