liveBook · Manning

Loopback address

As explained in The Well-Grounded Python Developer: How the pros use Python and Flask

Localhost is the hostname convention that identifies the local computer in network communications.

A loopback address lets a computer host and access a server locally, even without a network card. The conventional address is 127.0.0.1, also called localhost. section 6.4.2

Testing a local Flask server

Start Flask’s development server, then visit http://127.0.0.1:5000 in a browser. The server receives the request and can return “Hello World!”; port 5000 is a configurable default. section 6.4.2

* Serving Flask app "app.py" (lazy loading)
 * Environment: development
 * Debug mode: on
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 325-409-845

Use the server output to identify the local address, port, development mode, and command for stopping the process. section 6.4.2

How The Well-Grounded Python Developer: How the pros use Python and Flask covers it

How deep it goes
Defines the loopback interface and demonstrates browser access, but stops short of broader network configuration.
Examples
Uses Flask’s development server at 127.0.0.1:5000 and a browser request returning “Hello World!”.
What it assumes
Assumes familiarity with browsers and web servers while explaining the local address and port from the beginning.
What you can do after
Operate a local Flask server and verify its HTTP response through a browser.
How it connects
Connects localhost with IP addresses, ports, HTTP requests, web servers, and URL routes.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of The Well-Grounded Python Developer: How the pros use Python and Flask. The section links point to the parts of the book it draws on.