Python Flask server add another port to domain

Struggler picture Struggler · Jan 29, 2013 · Viewed 18.2k times · Source

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!

Answer

Lyndsy Simon picture Lyndsy Simon · Jan 29, 2013

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).