serverless-wsgi
Amazon AWS API Gateway WSGI wrapper
What it is and what it does
serverless-wsgi is a Serverless Framework plugin that packages and deploys Python WSGI applications to AWS Lambda, making them callable through API Gateway. It transparently converts API Gateway HTTP requests into standard WSGI format, allowing you to run unmodified Flask, Django, or Pyramid applications on Lambda without rewriting your code for a serverless environment.
The plugin handles the operational complexity: it automatically bundles your application's dependencies from requirements.txt, manages werkzeug as a core runtime dependency, and provides local development commands (wsgi serve for testing, wsgi exec for remote Python execution, wsgi manage for Django commands). It supports both API Gateway V1 and V2 payloads and includes convenience CLI commands for remote code execution and framework-specific management tasks.
Use it for:
- Deploy an existing Flask or Django web application to AWS Lambda without rewriting request/response handling.
- Run local development with sls wsgi serve to test your WSGI app before deploying to Lambda.
- Execute Django management commands or Flask CLI commands remotely on your deployed Lambda function.
- Automatically package and deploy Python dependencies specified in requirements.txt alongside your application.
- Handle file uploads, redirects, cookies, and other standard WSGI features transparently on API Gateway.
- Execute arbitrary Python or shell code remotely on your Lambda function using wsgi exec or wsgi command.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Bridges Python WSGI applications (Flask, Django, Pyramid) to AWS Lambda and API Gateway by converting HTTP requests to WSGI format and handling deployment packaging.
Yes, if you need to deploy a Python WSGI application to AWS Lambda with minimal code changes. The plugin is stable (Production/Stable status) and has no known vulnerabilities. Install friction is low. However, note that maintenance is aging—the last release was 429 days ago—so verify that it works with your specific framework version and Python runtime before committing to production use.
Install
serverless-wsgi on PyPI
pip
pip install serverless-wsgiuv
uv add serverless-wsgipoetry
poetry add serverless-wsgiInstalling serverless-wsgi
Before you install
Low install friction with a single runtime dependency (werkzeug). Maintenance status is aging—last commit was 2026-01-21 and the latest release 2025-06-11 came 429 days ago, though the repository remains active and not archived.
License in practice
Licensed under MIT (permissive), so you can use, modify, and distribute this package with minimal legal restrictions.
Quickstart
# Install via Serverless Framework
sls plugin install -n serverless-wsgi
# In serverless.yml, set handler and app path:
# functions:
# api:
# handler: wsgi_handler.handler
# events:
# - http: ANY /
# custom:
# wsgi:
# app: api.app
# Then deploy:
sls deploy
Requires Serverless Framework installed and AWS credentials configured; Python runtime must be specified in serverless.yml (e.g., python3.6 or later).
Verify before relying
- Whether the package works with Python versions beyond 3.6 despite the requires_python constraint.
- Current performance characteristics or known limitations with large WSGI applications on Lambda.
- Whether werkzeug is automatically included in deployments or must be explicitly listed in requirements.txt.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — werkzeug |
| Maintenance | aging — 429 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 195,654/month — #9,809 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: serverless_wsgi-3.1.0-py2.py3-none-any.whl
Keywords: wsgi, serverless, aws, lambda, api, gateway, apigw, flask, django, pyramid
Tags
More Dynamic Content packages
MarkupSafe provides a text object that escapes…
permissive · top 100 on PyPI
Jinja2Jinja2 is a templating engine that renders…
permissive · top 100 on PyPI
soupsieveSoupsieve is a CSS selector library designed to…
permissive · top 100 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
FlaskFlask is a lightweight WSGI web application…
permissive · top 1,000 on PyPI
MakoMako compiles Python-embedded templates into…
permissive · top 1,000 on PyPI
awsgi2Bridges WSGI-compatible web frameworks to AWS…
permissive · top 15,000 on PyPI
zappaZappa packages and deploys Python WSGI and ASGI…
permissive · top 15,000 on PyPI
apig-wsgiWraps a WSGI application to run as an AWS…
permissive · top 15,000 on PyPI
pyramidPyramid is a Python web framework for building…
permissive · top 5,000 on PyPI
functions-frameworkA lightweight FaaS framework that lets you…
permissive · top 5,000 on PyPI
WSGIProxy2WSGIProxy2 wraps a remote HTTP application as a…
permissive · top 15,000 on PyPI
aiohttp-wsgiRuns WSGI applications like Django and Flask on…
permissive · top 15,000 on PyPI
a2wsgiConverts between WSGI and ASGI applications…
permissive · top 5,000 on PyPI
chaliceChalice is a Python framework for building and…
permissive · top 15,000 on PyPI