aws-wsgi is a WSGI adapter that enables the use of WSGI-compatible Python frameworks (like Flask and Django) with AWS API Gateway's Lambda Proxy Integration. The project's GitHub repository was archived in March 2024, and its last release on PyPI was in July 2020. Users are encouraged to consider actively maintained forks like `awsgi2` or alternative solutions for new projects.
pip install aws-wsgiVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to integrate a simple Flask application with `aws-wsgi` to run on AWS Lambda via API Gateway. The `lambda_handler` function serves as the entry point for AWS Lambda, passing the event and context to `awsgi.response`.
For new projects or continued maintenance, consider migrating to an actively maintained fork like `awsgi2` (`pip install awsgi2`) or an alternative serverless WSGI solution like `serverless-wsgi`.
Ensure that your API Gateway stages are configured with the correct `binaryMimeTypes` (e.g., `image/png`, `font/woff2`) and that your Lambda response correctly sets `isBase64Encoded` to true for binary content.
For file uploads exceeding 6MB, use AWS S3 pre-signed URLs to allow clients to directly upload files to S3, bypassing Lambda's payload limit.
Verify that the IAM role associated with your Lambda function has all necessary permissions (e.g., `s3:GetObject`, `dynamodb:PutItem`) for any AWS services your application intends to access.
Ensure `aws-wsgi` is included in your Lambda deployment package (e.g., in a layer or directly in the zip file). When using `pip`, install to a specific target directory: `pip install aws-wsgi -t ./python` and then zip the `python` directory.
Verify the incoming API Gateway event structure matches the expected Lambda Proxy Integration format. Ensure clients are sending valid request bodies, especially for POST/PUT requests, and that appropriate `Content-Type` headers are set.
No dependency data recorded yet.