# Pagerless for Python

> One package, standard library only. Django, Flask, FastAPI and any ASGI or WSGI app, Celery, AWS Lambda and logging.

URL: https://pagerless.dev/integrations/python
Updated: 2026-10-22

## Set up

```bash
pip install pagerless
export PAGERLESS_KEY=pl_live_...
```

```python
import pagerless.auto
```

```python
pagerless.init()
pagerless.capture(route="POST /checkout")
pagerless.event("Refunds paused", "tell")
pagerless.deploy("2026.10.22-2")
```

```python
@pagerless.aws_lambda.handler
def handle(event, context): ...
```

```python
logging.getLogger().addHandler(pagerless.logging.PagerlessHandler())
```

```python
@pagerless.monitor("nightly-backup", pagerless.Schedule(cron="30 3 * * *"))
def backup(): ...

with pagerless.monitor("sync-prices", 3600):
    sync()
```

## What it catches

- Uncaught exceptions in the main thread, other threads and unraisable ones (`import pagerless.auto`).
- Request rate, errors and latency per route with the [Django](https://pagerless.dev/integrations/django), [Flask](https://pagerless.dev/integrations/flask) or [ASGI](https://pagerless.dev/integrations/fastapi) integrations.
- Celery task failures and missed beat runs ([Celery](https://pagerless.dev/integrations/celery)).
- Lambda handler exceptions, flushed before return.
- ERROR log records, as the exception when there is one, else grouped by call site.

Python 3.9 or newer, standard library only. `npx pagerless connect` doesn't edit Python code yet; add these lines by hand.

## Questions

### Which frameworks?

[Django](https://pagerless.dev/integrations/django), [Flask](https://pagerless.dev/integrations/flask), [FastAPI and Starlette](https://pagerless.dev/integrations/fastapi) (any ASGI app), any WSGI app, [Celery](https://pagerless.dev/integrations/celery), AWS Lambda and the logging module.

### Does it add dependencies?

No. It is standard library only, Python 3.9 or newer.
