0

I'm not able to access my python server outside of local system but static ip is configured and it works fine with virtual servers like python3 -m http.server but when I create flask app it doesn't work.

from flask import Flask

app = Flask(__name__)

@app.route('/')
def index():
    return "Accessible"

if __name__ == '__main__':
    app.run(port=5000)

Here is the code

1 Answers1

1

It is because flask runs on localhost (127.0.0.1) by default, so for accessing flask server globally you have to pass anywhere access IP i.e. 0.0.0.0 .

app.run(host = '0.0.0.0', port = 5000)