Flask Applications

Can someone tell me how to get a Flask application up and running under LiteSpeed?

How would I route all incoming requests to: http://www.mydomain.com/api to the Python Flask app that looks something like this?
def application(environ, start_response):
    status = '200 OK'
    output = 'Hello World!'
    response_headers = [('Content-type', 'text/plain'),  ('Content-Length', str(len(output)))]
    start_response(status, response_headers)
    return [output]
Thanks in advance.
Last edited by a moderator:


Staff member
We don't have a particular wiki on how to configure flask application since you can easily refer to flask forum or flask web site, however Litespeed does provide Python support and we do provide wiki on how to install/configure Python program in general. such as links provide by NiteWave as well as the following if LSWS native mode.
please let us know if you have any questions when you follow along with the wiki.
All of the walkthroughs I have seen expect the the incoming HTTP request to be for a specific .wsgi file like the following:

However, my needs are for a REST API. So incoming requests will be something like:

What I want is for all requests to http://IP-ADDRESS:8088/api to be handed off to a specific python file/function which will handle all WSGI requests.

I'm not sure these examples satisfy my needs. Either that or I am not fully understanding it all.

Last edited by a moderator: