The default run provides only 127.0.0.1:5000 access

Flask project apps are started using the Run method, and startup provides access to only 127.0.0.1:5000 by default.

  • Use 127.0.0.1:5000 for access

  • Access using the IP address of the local NIC

Set the IP address and PORT bound to run

  • Use 127.0.0.1:5000 for access

  • Access using the IP address of the local NIC

As shown in the result, the IP address 127.0.0.1 cannot be accessed, and only the bound IP address can be accessed. So how can you provide access to all IP addresses?

This uses the wildcard IP address: 0.0.0.0

Set the wildcard IP address to 0.0.0.0

  • Use 127.0.0.1:5000 for access

  • Access using the IP address of the local NIC

Both IP addresses are now accessible.