0

I have spent a lot of time trying to find a solution for this, but with no success.

I have tried setting host = "0.0.0.0"

I have tried explicitly disabling debugger mode.

I have tried ngrok before.

I have heard of Heroku but I want to leave it last for final launch.

Right now, I just want to test the flask web app on my phone.

Is there a way to host my web app ONLY on my own wifi, so that only people connected to my wifi can access it.

1 Answers1

2

When starting your Flask server to make it visible externally you have to start it with the parameter host set to "0.0.0.0"

app.run(host="0.0.0.0")

Then you have to find your local IP your computer.

And then you can go to your mobile and go to the URL: <local_ip>:5000

(The default port is 5000 when you launch Flask)

AlexisG
  • 2,476
  • 3
  • 11
  • 25
  • It doesn't show the website, it's taking forever to load – Saifeldin Farid Sep 17 '20 at 20:57
  • And if you do `app.run(port=5000, host="0.0.0.0")` ? Maybe the default port is odiffrent if you have some config variable presents. – AlexisG Sep 17 '20 at 21:09
  • I have noticed that the website's name actually appears in the search suggestions when I type my IP:5000, what really happens is that, when I click search, the website takes forever to load – Saifeldin Farid Sep 17 '20 at 21:11
  • I am wondering if it could be a compatibility issue, do you think it is ? – Saifeldin Farid Sep 17 '20 at 21:11
  • Our router/access point has a "guest" zone that will only route traffic to the internet, and not to other devices on our intranet. Is this possibly the case for you? – Dave W. Smith Sep 17 '20 at 21:15
  • I don't know. Each time I've done it, it worked. But I've already encountered this problem when using my public IP. – AlexisG Sep 17 '20 at 21:17