Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access Flask web server from mobile device? [duplicate]

I have FLask web development server running on my Mac @ 127.0.0.1:5000/. Both my mac and my android device are connected to the same WLAN. I am unable to access my flask website by entering the IP address of my mac(192.168.8.103:5000) into the browser of my android device. But I can access the webpage from my apache server running on my Mac by entering 192.168.8.103 into the browser of my android device. Can I access the flask webserver from my mobile?

like image 688
viruchith Avatar asked Feb 02 '26 22:02

viruchith


1 Answers

You need to run the app with your IPv4 address

app.run(debug=True, host= '192.168.8.103') assuming 192.168.8.103 is your IPv4 if not, replace it with your IPv4

like image 173
Patch Avatar answered Feb 05 '26 14:02

Patch



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!