I have one flask application script as given below :
from flask import Flask
app = Flask(__name__)
@app.route(\"/\")
def main(job_id):
Flask development server by default listens on port 5000
so when you run a Flask app without port number it will run on 5000
.
You can run a number of Flask app on the same machine but with the different port numbers. Let's say your scripts names are script1.py
and script2.py
:
$ export FLASK_APP=script1.py
$ flask run --host 0.0.0.0 --port 5000
Open up a new terminal
$ export FLASK_APP=script2.py
$ flask run --host 0.0.0.0 --port 5001
Did you clear cache memory before running second script. There are times when browser stored previos data on the port so it will display old data.
You can clear the cache memory and then run second script. then execute and see. I hope it will solved problem