Open the port 5000 in your machine. Follow the steps:
- Navigate to Control Panel, System and Security and Windows Firewall.
- Select Advanced settings and highlight Inbound Rules in the left pane.
- Right click Inbound Rules and select New Rule.
- Add the port you need to open and click Next(5000 in your case).
- Add the protocol (TCP or UDP) and the port number into the next window and click Next.
- Select Allow the connection in the next window and hit Next.
- Select the network type as you see fit and click Next.
- Name the rule something meaningful and click Finish.
Then try to access through <your ip>:5000
sample code is as follows:
import flask
app = flask.Flask(__name__)
app.config["DEBUG"] = True
@app.route('/', methods=['GET'])
def home():
return "<h1>Test Data</p>"
app.run(host='0.0.0.0')
and run your application through cmd as python api.py
where api.py
is the file name