Bootstrap FreeKB - Flask - Run Flask on a specific port
Flask - Run Flask on a specific port

Updated:   |  Flask articles

By default, a Flask app will run on port 5000. There are quite a few different ways to run your Flask app on some other port. 

For example, let's say you are using the flask run command to run your Flask app. The --port option can be used to specify the port you want to use.

~]$ flask run --port 12345

 

Or, you could use the port option in your main.py file.

from website import my_website

app = my_website()

if __name__ == '__main__':
    app.run(host="10.17.5.125", port="12345")

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 51a904 in the box below so that we can be sure you are a human.