User Tools

Site Tools


setup_python_flask_application_by_port

Setting up a Python Flask Application

If you have a metaARPA account, on meta you can check your assigned port with id (becuase your assigned port is your user id).

I was able to get a python flask development server running just now with this:

First, setup a virturalenv with: $ python3 -m venv venv

Then activate it: $ source venv/bin/activate

then install Flask:

$ pip install flask

Then throw this into a file like app.py

from flask import Flask

app = Flask(__name__)


@app.route('/')
def hello_world():
    return 'Hello World'

if __name__ == '__main__':
    app.run(host="0.0.0.0", port=<your-id-here>)

run with python app.py and then you should see the ip address to run your app in your browser.

setup_python_flask_application_by_port.txt · Last modified: by peteyboy