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.