On Day 7, we connected the two worlds: the HTML/CSS web design we built yesterday and the Python logic we learned last week. The glue that connects them is Flask—a lightweight Python web framework.

1. Flask Routing Basics

Flask is refreshingly simple. You import Flask, create an app instance, and define routes using decorators like @app.route('/'). Whenever someone visits that URL in their browser, Flask runs that specific Python function and returns the web page.

2. Templates and Web Forms

To serve our actual webpage, we used render_template('index.html'). When the user types into an input box and hits Submit, the form sends an HTTP POST request to Flask. Flask grabs the text using request.form.get('message'), processes it, and sends the answer back to the frontend using Jinja tags like {{ message }}.

3. The 120-Line Reality Check

An interesting moment happened when Rashmi introduced Hugging Face accounts for using open-source models. Most of the class struggled just to sign up, while I had already been using my account since 2024. Then, when the cohort felt overwhelmed by a 120-line Flask file, I had a quiet moment of reflection: on my personal projects, I've managed codebases with thousands of lines of code. It wasn't about feeling superior—it was just realizing how differently you see programming once you build real projects on your own time.

Key Learnings

  • Starting a local Flask web server and declaring URL endpoints.
  • Serving dynamic HTML pages from the templates folder using render_template.
  • Capturing form data sent via HTTP POST requests.
  • The value of independent project experience: it shrinks big challenges into everyday tasks.

Tools & Stack

  • Flask
  • Python 3.11
  • HTML Forms
  • Jinja2

Challenges Overcome

  • Fixing 405 'Method Not Allowed' errors by making sure the route accepts POST requests.
  • Matching template variable names in Jinja with the variables passed from Flask.

Task to be Performed

  • Create a basic Flask application with a home route.
  • Link the route to an HTML form in the templates directory.
  • Process text submitted through the form and display the response back on the screen.

Related Logs

Day 00

Day 00: Onboarding, Orientation, and the 2-Week AI Roadmap

Walking into Virtual Height for day zero: getting our badges, meeting our lead mentors, and mapping out what we will build over the next two weeks.

May 29, 2026 • 4 min readRead Log ➔
Day 01

Day 01: First Day as an AI Intern, Python Basics, and a Wild Flex

Day 1 kicks off with lead mentor Rashmi. We break down AI vs ML vs Deep Learning, test Python terminal scripts, and demo my custom chatbot to the room.

Jun 01, 2026 • 4 min readRead Log ➔