Plain (@plainframework) profile picture

The full-stack Python framework designed for humans and agents. Follow for development updates. Follow @davegaeddert for more background.

Kansas
Joined July 2024
Every Plain setting ending in TOKEN, KEY, SECRET, PASSWORD or USER is now Secret[...] and masked, or says PUBLIC in its name. A test enforces it across every package. First catch: EMAIL_HOST_USER. Postmark uses your API token as the SMTP username.
19
StreamingResponse bodies now run in the request's context. The generator queries the database on the same connection as the view, a cursor from Model.query.iterator() stays alive to the last chunk, and the request's trace covers sending the body.
16
Secrets in Plain are a type SECRET_KEY: Secret[str] `plain settings get` now masks them like `settings list` already did. Matters more with agents: everything a command prints lands in the transcript. `plain settings get --reveal` is the explicit ask
22
Plain now requires Python 3.14. The first payoff is sql() in plain-postgres: the SQL is the literal parts of a t-string, every interpolated value binds as a parameter, and passing a plain str is a type error.
33
Starting to rework some of the postgres APIs
1
22
plain docs cache --api prints the real signatures for the version you have installed. Docs ship inside each Plain package — your agent reads them instead of guessing from training data.
1
18
plain.loginlink: link expiration is now a class attribute — link_expires_in = 60 * 15 on your form, no method override needed. Docs now spell out the real semantics: links stay valid until expiry, deliberately, so mail scanners can't burn them before your user clicks.
16
Dev secrets can now live in git. `plain env set` encrypts a value into your committed .env.dev, one key per project. A fresh clone — or a hosted agent sandbox — just needs DEV_ENV_KEY and every dev credential comes with the repo.
1
28
Response.status_code is read-only in Plain now. The status decides things everything downstream builds on — whether a body is allowed, how the response is framed on the wire — so it's fixed at construction. Renderers take it directly: self.render(form=form, status_code=422)
1
26
plain 0.160.0 makes that bug unrepresentable instead of just catching it: bodiless responses (204, 304, HEAD) refuse content at construction, and Response.status_code is read-only — so you can't build a valid response and mutate it into an invalid one.
31
We were seeing intermittent 503s behind Heroku's router that never showed up in our app logs. Root cause: a 204 response with a body. The body bytes go onto the keep-alive connection unframed, and the router reads them as the start of the next response.
1
1
1
329
Replaced Model.save() with create() and update() in Plain. The old version branched on whether a primary key was set, which meant reading a save() call told you nothing about whether it wrote a new row.
1
20
Two new packages in Plain: plain.mcp and plain.oauthserver. Together they mean an AI client can connect to your app as a real, authenticated user — PKCE, dynamic client registration, token rotation.
1
38
Plain doesn't auto-index foreign keys — you declare the indexes you want. Add a composite index starting with that FK and the single-column one is redundant anyway: Postgres uses the composite's leftmost prefix. Explicit indexes, no overlap by default.
1
1
1,273
Making a little progress on the admin UI... - pyproject.toml project name for branding - icons for sidebar nav - gravatar for logged in user
1
5
157
Experimenting with a MARK comment in the Plain source code, which we can render as sections when displaying docs. Inspired by # pragma mark in Objective-C and MARK in Swift
1
4
172
Plain now ships with `plain install` and `plain upgrade` commands. In some ways these are glorified AI prompt generators! But integrating with coding agents in this way leaves API keys and control completely in your hands. Use any provider or tool you want.
1
1
221
From seeing a problem to fixing it, with the new opentelemetry instrumentation, plain-observer, and `plain observer diagnose`. What else can we do if we embrace coding agents?!
1
585
Models in plain no longer support custom primary keys. Everything gets a bigint auto id field! Time will tell whether more is really needed here, but in most cases you shouldn't need to customize primary keys in new apps and this sets a clear expectation across all of Plain.
41