Skip to main content

Python module to make Flask compatible with AWS Lambda for creating RESTful applications

Project description

Python module to make Flask compatible with AWS Lambda for creating RESTful applications.


pip install flask-lambda


This module works pretty much just like Flask. This allows you to run and develop this applicaiton locally just like you would in Flask. When ready deploy to Lambda, and configure the handler as:

Here is an example of what would look like:

from flask_lambda import FlaskLambda

app = FlaskLambda(__name__)

@app.route('/foo', methods=['GET', 'POST'])
def foo():
    data = {
        'form': request.form.copy(),
        'args': request.args.copy(),
        'json': request.json
    return (
        json.dumps(data, indent=4, sort_keys=True),
        {'Content-Type': 'application/json'}

if __name__ == '__main__':


Nothing special here, this module works without issue with Flask-RESTful as well.

API Gateway

Configure your API Gateway with a {proxy+} resource with an ANY method. Your “Method Response” should likely include an application/json “Response Body for 200” that uses the Empty model.


Consider using python-mu.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flask-lambda-0.0.4.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distribution

flask_lambda-0.0.4-py2.py3-none-any.whl (5.2 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page