-1

I have cloned this repo in my Windows system for Flask-PWA app https://github.com/umluizlima/flask-pwa

After running the repo as per README instructions, I am facing the problem that it is loading flask app on http://127.0.0.1:5000/ . On this link it shows up an older Flask app that I had made. How can I flush this 5000 port or add a custom port? Or is there another way to solve this problem?

1 Answers1

1

Port can be specified in the parameters of the run function of the app. For instance:

from flask import Flask

app = Flask(__name__)
...
host = '0.0.0.0'
port = 5001
app.run(host=host, port=port)
onekiloparsec
  • 2,013
  • 21
  • 32
  • you are right but i tried https://stackoverflow.com/questions/20212894/how-do-i-get-flask-to-run-on-port-80 solution, was able to run the app on localhost but it doesnt include the PWA features like downloading the app. Any leads for that? – Rabiya Khan Sep 09 '21 at 09:31
  • PWA features? PWA as in Progressive Web App? If so, it is an unrelated question. And AFAIK, a PWA is a client-side question to be adressed with JS frameworks, not a backend one handled by Flask. – onekiloparsec Sep 10 '21 at 06:36
  • my problem is that, because I have used several different port numbers like 80, 8080, 5100, 5000 during development, now i have run out of new port numbers as the earlier mentioned ones keep loading the previous projects. So is there a way to flush out these previously used ports? – Rabiya Khan Sep 10 '21 at 08:24