skillfed

serverless-wsgi

Amazon AWS API Gateway WSGI wrapper

serverless-wsgi v3.1.0 195.7K downloads/30d#9,809 on PyPI499
Permissive license AGING released

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-wsgi

uv

uv add serverless-wsgi

poetry

poetry add serverless-wsgi

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

deploy flask to aws lambdawsgi serverless framework plugindjango api gateway lambdapython wsgi aws deploymentserverless python web frameworklambda http handler wsgipyramid serverless deployment
serverless-deploymentaws-lambdawsgi-adapter

More Dynamic Content packages