Flask server visible when hosted on macbook, but not when hosted on windows desktop? (Tried everything?) [duplicate]
This question already has an answer here:
Configure Flask dev server to be visible across the network
7 answers
My macbook and windows desktop are on the same wifi network.
Here is the python 3 code I run on my Mac (myFlask.py):
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello from Mac"
pn = 5000
ip = "192.168.1.146"
if __name__ == '__main__':
app.run(host = ip,port=pn)
When I run this on mac, and I can enter 192.168.1.146:5000 as a url on the browser on both devices and see "Hello from Mac"
Here is the python 3 code I run on my Desktop (myFlask.py):
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello from Windows"
pn = 5000
ip = "192.168.1.105"
if __name__ == '__main__':
app.run(host = ip,port=pn)
The problem: When I run this on the windows desktop, and when I enter 192.168.1.105:5000 as a url on the browser on both device, I see "Hello from Windows" on the desktop, but "This site can’t be reached" on the mac.
I tried the following:
- I double checked the IP addresses, and 192.168.1.105 is the correct one (ipv4). I also tried all the other IP addresses from ipconfig on the windows command line, but still no luck.
- I took a look at externally visible server at http://flask.pocoo.org/docs/0.12/quickstart/ and tried to do $python3 myFlask.py --host=0.0.0.0 No luck here.
- I checked to see if DHCP is enabled in my router (Linksys) and yes it is enabled.
- I turned on all sharing settings on Home, Public, and Domain in the control panel at windows.
- I turned off the FireWall settings.
Even after all this, neither my mac nor my android phone nor my iphone nor my other mac can find the flask server hosted on the windows desktop. But all my other devices (including windows desktop) can see the flask server hosted by the mac.
What should I do?
python windows macos flask server
marked as duplicate by davidism
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 15 '18 at 1:09
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
Configure Flask dev server to be visible across the network
7 answers
My macbook and windows desktop are on the same wifi network.
Here is the python 3 code I run on my Mac (myFlask.py):
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello from Mac"
pn = 5000
ip = "192.168.1.146"
if __name__ == '__main__':
app.run(host = ip,port=pn)
When I run this on mac, and I can enter 192.168.1.146:5000 as a url on the browser on both devices and see "Hello from Mac"
Here is the python 3 code I run on my Desktop (myFlask.py):
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello from Windows"
pn = 5000
ip = "192.168.1.105"
if __name__ == '__main__':
app.run(host = ip,port=pn)
The problem: When I run this on the windows desktop, and when I enter 192.168.1.105:5000 as a url on the browser on both device, I see "Hello from Windows" on the desktop, but "This site can’t be reached" on the mac.
I tried the following:
- I double checked the IP addresses, and 192.168.1.105 is the correct one (ipv4). I also tried all the other IP addresses from ipconfig on the windows command line, but still no luck.
- I took a look at externally visible server at http://flask.pocoo.org/docs/0.12/quickstart/ and tried to do $python3 myFlask.py --host=0.0.0.0 No luck here.
- I checked to see if DHCP is enabled in my router (Linksys) and yes it is enabled.
- I turned on all sharing settings on Home, Public, and Domain in the control panel at windows.
- I turned off the FireWall settings.
Even after all this, neither my mac nor my android phone nor my iphone nor my other mac can find the flask server hosted on the windows desktop. But all my other devices (including windows desktop) can see the flask server hosted by the mac.
What should I do?
python windows macos flask server
marked as duplicate by davidism
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 15 '18 at 1:09
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
Configure Flask dev server to be visible across the network
7 answers
My macbook and windows desktop are on the same wifi network.
Here is the python 3 code I run on my Mac (myFlask.py):
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello from Mac"
pn = 5000
ip = "192.168.1.146"
if __name__ == '__main__':
app.run(host = ip,port=pn)
When I run this on mac, and I can enter 192.168.1.146:5000 as a url on the browser on both devices and see "Hello from Mac"
Here is the python 3 code I run on my Desktop (myFlask.py):
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello from Windows"
pn = 5000
ip = "192.168.1.105"
if __name__ == '__main__':
app.run(host = ip,port=pn)
The problem: When I run this on the windows desktop, and when I enter 192.168.1.105:5000 as a url on the browser on both device, I see "Hello from Windows" on the desktop, but "This site can’t be reached" on the mac.
I tried the following:
- I double checked the IP addresses, and 192.168.1.105 is the correct one (ipv4). I also tried all the other IP addresses from ipconfig on the windows command line, but still no luck.
- I took a look at externally visible server at http://flask.pocoo.org/docs/0.12/quickstart/ and tried to do $python3 myFlask.py --host=0.0.0.0 No luck here.
- I checked to see if DHCP is enabled in my router (Linksys) and yes it is enabled.
- I turned on all sharing settings on Home, Public, and Domain in the control panel at windows.
- I turned off the FireWall settings.
Even after all this, neither my mac nor my android phone nor my iphone nor my other mac can find the flask server hosted on the windows desktop. But all my other devices (including windows desktop) can see the flask server hosted by the mac.
What should I do?
python windows macos flask server
This question already has an answer here:
Configure Flask dev server to be visible across the network
7 answers
My macbook and windows desktop are on the same wifi network.
Here is the python 3 code I run on my Mac (myFlask.py):
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello from Mac"
pn = 5000
ip = "192.168.1.146"
if __name__ == '__main__':
app.run(host = ip,port=pn)
When I run this on mac, and I can enter 192.168.1.146:5000 as a url on the browser on both devices and see "Hello from Mac"
Here is the python 3 code I run on my Desktop (myFlask.py):
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello from Windows"
pn = 5000
ip = "192.168.1.105"
if __name__ == '__main__':
app.run(host = ip,port=pn)
The problem: When I run this on the windows desktop, and when I enter 192.168.1.105:5000 as a url on the browser on both device, I see "Hello from Windows" on the desktop, but "This site can’t be reached" on the mac.
I tried the following:
- I double checked the IP addresses, and 192.168.1.105 is the correct one (ipv4). I also tried all the other IP addresses from ipconfig on the windows command line, but still no luck.
- I took a look at externally visible server at http://flask.pocoo.org/docs/0.12/quickstart/ and tried to do $python3 myFlask.py --host=0.0.0.0 No luck here.
- I checked to see if DHCP is enabled in my router (Linksys) and yes it is enabled.
- I turned on all sharing settings on Home, Public, and Domain in the control panel at windows.
- I turned off the FireWall settings.
Even after all this, neither my mac nor my android phone nor my iphone nor my other mac can find the flask server hosted on the windows desktop. But all my other devices (including windows desktop) can see the flask server hosted by the mac.
What should I do?
This question already has an answer here:
Configure Flask dev server to be visible across the network
7 answers
python windows macos flask server
python windows macos flask server
asked Nov 13 '18 at 3:26
prince0fQueens
103
103
marked as duplicate by davidism
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 15 '18 at 1:09
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by davidism
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 15 '18 at 1:09
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
This gets into the vagaries of networking. Change to
ip = '0.0.0.0'
and try again. When you tried to pass --port=0.0.0.0
to your app, the option was ignored, since your app isn't parsing options. The flask
runner does parse them. On the Mac side, the invocation would be
FLASK_APP=myApp.py flask run --port=0.0.0.0
I don't know what the equivalent would be on Windows.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
This gets into the vagaries of networking. Change to
ip = '0.0.0.0'
and try again. When you tried to pass --port=0.0.0.0
to your app, the option was ignored, since your app isn't parsing options. The flask
runner does parse them. On the Mac side, the invocation would be
FLASK_APP=myApp.py flask run --port=0.0.0.0
I don't know what the equivalent would be on Windows.
add a comment |
This gets into the vagaries of networking. Change to
ip = '0.0.0.0'
and try again. When you tried to pass --port=0.0.0.0
to your app, the option was ignored, since your app isn't parsing options. The flask
runner does parse them. On the Mac side, the invocation would be
FLASK_APP=myApp.py flask run --port=0.0.0.0
I don't know what the equivalent would be on Windows.
add a comment |
This gets into the vagaries of networking. Change to
ip = '0.0.0.0'
and try again. When you tried to pass --port=0.0.0.0
to your app, the option was ignored, since your app isn't parsing options. The flask
runner does parse them. On the Mac side, the invocation would be
FLASK_APP=myApp.py flask run --port=0.0.0.0
I don't know what the equivalent would be on Windows.
This gets into the vagaries of networking. Change to
ip = '0.0.0.0'
and try again. When you tried to pass --port=0.0.0.0
to your app, the option was ignored, since your app isn't parsing options. The flask
runner does parse them. On the Mac side, the invocation would be
FLASK_APP=myApp.py flask run --port=0.0.0.0
I don't know what the equivalent would be on Windows.
answered Nov 13 '18 at 5:35
Dave W. Smith
16.2k22430
16.2k22430
add a comment |
add a comment |