-1

at the moment I'm trying to figure out, how to make a flask app accessible from different networks at the same time. For example, my pc is inside network a via wifi and also in network b through an ethernet cable. The flask app is showing when starting:

FLASK_APP = app.py
FLASK_ENV = development
FLASK_DEBUG = 1
 * Serving Flask app 'app.py' (lazy loading)
 * Environment: development
 * Debug mode: on
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 103-934-430
 * Running on all addresses.
   WARNING: This is a development server. Do not use it in a production deployment.
 * Running on http://10.220.4.151:5000/ (Press CTRL+C to quit)

10.220.4.151 is the ip address of my WLAN interface. So my flask server is accessible from all devices in my wifi network but is not accessible from all my devices in my lan-network.

Is it possible to make my flask app accessible from both?

Stagory
  • 24
  • 3
  • so when I change the pc it is working ... switched off the firewall, which also didn't help. The only difference between both systems is that on one is Microsoft Windows 10 Pro installed and on the other Microsoft Windows 10 Education N – Stagory Oct 01 '21 at 08:42

1 Answers1

1

Yes, but this has nothing much to do with flask. Firstly:

WARNING: This is a development server. Do not use it in a production deployment.

pay heed to this. You do not want to be exposing the dev server to outside traffic. You probably don't want to be exposing the dev server to both your LANs, either (why are you trying to do this?).

However, the problem is that of hosting your server at an IP which is accessible from both your wifi and ethernet subnetworks. Probably you can just host it at 0.0.0.0, and your OS will handle the routing for you. If not this is an OS issue and depends on how routing is set up in your particular case.

Please, though, be aware that the dev server is really not for public deployment.

See this question for discussion of 0.0.0.0, and note you may have permissions problems (which may be why you ran it at the IP address in the first place).

2e0byo
  • 5,305
  • 1
  • 6
  • 26