Initial Condition: I have a Python Flask server running on a remote machine that I am accessing via Linux(OpenSuse) command line. The server works perfect. It renders the html for xyz.com:5000.
Problem: I am a new user added. I want the server to read my .py files. What do I do? Do I need a new port number? Or will it be xyz.myusername.com:5000? What configurations do I have to change? Does the superuser need to intervene?
Thanks!
Run multiple servers simultaneously Create another Flask server script that runs on another port, for example port 4001. Then open two separate terminals and run both scripts. You will see something like this: Both servers are now running locally, each with their own port.
Flask's built-in server is not intended for production use - or at least, the documentation refers to it as a "local development server".
For production, something like Tornado, gunicorn, or even Apache is what you'll need to be using.
See also: Flask documentation covering the Flask.run()
method.
That said - it's just a Python program. There's no reason you couldn't run your own on a different port via app.run(port=5001)
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With