flask 'hello world' not working flask 'hello world' not working flask flask

flask 'hello world' not working


I don't know why but when I change

app.run()

to

app.run(port=4996)

it starts working. No idea why the default port is throwing an error. Oh well.


from flask import Flaskapp = Flask(__name__)@app.route('/')def index():    return 'Hello World'if __name__ == '__name__':    app.run()app.run(port=5000)


For Windows machines you can use the command in cmd:

set FLASK_APP=python_file.pyflask run