How Do People See Our Pages?
You have built real HTML pages. You can open them on your own computer and see them in your browser. But here is the thing — only you can see them. If a friend tried to visit your page right now, they could not.
So how does YouTube work? How does Google work? How does any website in the world show up for anyone, anywhere?
The missing piece — a server
Right now, when you open your HTML file, your browser reads it directly from your hard drive. No network involved. Just a file on your computer.
A real website works differently. There is a program running on a computer somewhere — called a server — whose only job is to listen for requests and respond with the right page.
Here is what happens when you type youtube.com:
- Your browser sends a request: "Hey YouTube server, give me your homepage"
- The server receives the request
- The server finds the right HTML and sends it back
- Your browser draws the page
That middle part — steps 2 and 3 — is the server. It is always running, always listening, always ready to respond.
You already know how to write one
Here is the good news: a server is just a program. And you already know how to write programs — in Python.
That is exactly what you are about to do. You are going to write a Python program that listens for requests and responds with your HTML pages.
And you are not going to write it from scratch, because other developers already did the hard work for you.
Enter Flask
Flask is code written by other developers, packaged up and shared with the world. It handles all the complicated server mechanics — listening on a port, reading requests, sending responses — so that you can focus on just writing your pages and routes.
You write a few lines of Python using Flask, run the file, and suddenly you have a working web server on your own computer. Anyone on the same network can visit it. That is what "running locally" means — your computer is the server.
Later, when you are ready, you will move that same code to a real server on the internet and people everywhere will be able to visit it. But one step at a time. For now — local.
Think about it
You built the HTML (the frontend). Flask will be the Python server (the backend). You are about to connect both sides for the first time.
Before moving on: can you explain in your own words what a server does? If you can say it simply, you understand it.