Authdog’s Python bindings are **one package, five frameworks**. Each framework has its own guide and five-minute path. Pick the one you run:

| Framework | Guide | Quickstart | Extra |
| --- | --- | --- | --- |
| FastAPI | [Guide](/docs/backend/fastapi) | [Quickstart](/docs/quickstarts?sdk=fastapi) | `[fastapi]` |
| Django | [Guide](/docs/backend/django) | [Quickstart](/docs/quickstarts?sdk=django) | `[django]` |
| Flask | [Guide](/docs/backend/flask) | [Quickstart](/docs/quickstarts?sdk=flask) | `[flask]` |
| Starlette | [Guide](/docs/backend/starlette) | [Quickstart](/docs/quickstarts?sdk=starlette) | `[starlette]` |
| aiohttp | [Guide](/docs/backend/aiohttp) | [Quickstart](/docs/quickstarts?sdk=aiohttp) | `[aiohttp]` |

All five share the same cookie / bearer token and OIDC `userinfo` flow. The public key (`pk_...`) selects the environment.

## Install

These session bindings are **not** the PyPI package `authdog`. `pip install authdog` installs the [management API client](/docs/sdks/python) (`AuthdogClient`, 0.1.1). It does not provide `authdog.fastapi` or the other framework modules.

The bindings are **unreleased on PyPI**. Do not `pip install authdog-fastapi` in production. Source lives in [`packages/python`](https://github.com/authdog/web-sdk/tree/main/packages/python) (Python 3.10+, `httpx` 0.27+). Clone or pin a commit, then install the extra for your framework:

```bash
python -m pip install "./packages/python[fastapi]"
```

Minimum extras: FastAPI 0.110, Django 4.2, Flask 3.0, Starlette 0.37, aiohttp 3.9. Published compatibility is not yet guaranteed.

## Shared contract

Every binding resolves the same `AuthdogContext` (`token`, `user`, `is_authenticated`, `user_info`). The resolver prefers `authdog-session`, then `Authorization: Bearer <token>`. Missing or failed `userinfo` yields anonymous context. Only `meta.code == 200` with a user sets `is_authenticated`.

`session` / middleware is informational. `require_auth` is the 401 boundary. `fetch_user=False` leaves `user` as `None` and `is_authenticated` false, so the built-in gate rejects.

Django and Flask drive `userinfo` with `asyncio.run` on their sync view paths. Starlette and aiohttp are async.

## Next

- [Backend requests](/docs/backend)
- [Python authentication guide](/guides/python/authentication) (FastAPI)
- [Python access-control guide](/guides/python/access-control) (FastAPI)
