PYTHON APPLIEDChapter 12 · Python for Web Development
What a backend does
A backend is a server that listens for HTTP requests and returns responses. It handles data storage, business rules, and authentication. Python is one of the most popular backend languages because of its readable syntax and rich ecosystem of web frameworks.
Worked example
# Conceptual flow of a backend request:
#
# 1. Browser sends: GET /api/stars
# 2. Server receives the request
# 3. Server queries a database
# 4. Server sends JSON back:
# {"stars": ["Vega", "Sirius", "Polaris"]}How it reads
- HTTP is the protocol browsers and servers use to communicate
- A backend typically reads from and writes to a database
- Python frameworks like Flask, Django, and FastAPI handle HTTP for you

Cloud tip: The frontend (HTML, CSS, JS) runs in the browser. The backend runs on a server and sends data the frontend displays.


