Categories
Python Answers

How to change the host and port that the Python flask command uses?

Spread the love

Sometimes, we want to change the host and port that the Python flask command uses.

In this article, we’ll look at how to change the host and port that the Python flask command uses.

How to change the host and port that the Python flask command uses?

To change the host and port that the Python flask command uses, we can use the -h flag to change the host and the -p flag to change the port.

For instance, we write

flask run -h localhost -p 3000

to run our flask app with the host set to localhost and the port set to 3000.

Conclusion

To change the host and port that the Python flask command uses, we can use the -h flag to change the host and the -p flag to change the port.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *