mangum 0.6.9
pip install mangum==0.6.9
Released:
Serverless ASGI
Navigation
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: MIT License (MIT)
- Author: Jordan Eremieff
Classifiers
- License
- Operating System
- Programming Language
Project description
Mangum
Mangum is an adapter for using ASGI applications with AWS Lambda & API Gateway.
Status: This project may face periods of inactivity from time to time, but PRs are welcomed.
Requirements
Python 3.7+
Installation
pip3 install mangum
Usage
The adapter class Mangum
accepts the following optional arguments:
-
debug
: bool (default=False)Enable a simple error response if an unhandled exception is raised in the adapter.
-
spec_version
: int (default=3)Set the ASGI specification version. ASGI 3 uses a single-callable, ASGI 2 uses a double-callable.
-
enable_lifespan
: bool (default=True)Specify whether or not to enable lifespan support.
Example
from mangum import Mangum
async def app(scope, receive, send):
await send(
{
"type": "http.response.start",
"status": 200,
"headers": [[b"content-type", b"text/plain; charset=utf-8"]],
}
)
await send({"type": "http.response.body", "body": b"Hello, world!"})
handler = Mangum(app, enable_lifespan=False) # disable lifespan for raw ASGI example
Frameworks
Any ASGI framework should work with Mangum, however there are cases where certain non-ASGI behaviour of an application will cause issues when deploying to a serverless platform. You may also need to specify spec_version=2
for frameworks that do not support the latest ASGI version.
Project details
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: MIT License (MIT)
- Author: Jordan Eremieff
Classifiers
- License
- Operating System
- Programming Language
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file mangum-0.6.9.tar.gz
.
File metadata
- Download URL: mangum-0.6.9.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6b93f5491b7f38d212b08500a44d974f8cc1043f79b994c6426baece901dfd1 |
|
MD5 | 86dab9e3a4b63570cf0284e26ab0ebaa |
|
BLAKE2b-256 | 65172955b30bf58cc19249a3e682a43bb68e878cf54f29d572202307e93662e1 |