As time passed, I found myself enjoying working with Flask.

It does have its issues, and some of them are host-dependent. For example, waitress and Gunicorn (Green Unicorn) are easier to setup and use than gevent with my host.

A Minimal Application

From the official site:

from flask import Flask

app = Flask(__name__)

@app.route("/")
def hello_world():
    return "<p>Hello, World!</p>"

Running your app in Flask

flask --app hello run

Older versions of Flask will not recognize --app.

gevent

If you manage to get gevent and all its dependencies installed, just do the following in:

from gevent.pywsgi import WSGIServer
from hello import create_app

app = create_app()
http_server = WSGIServer(("127.0.0.1", 8000), app)
http_server.serve_forever()

waitress

Easier yet: waitress-serve --host 127.0.0.1 hello:app

url_for

url_for('static', filename='favicon.ico')