展示 HN:Plain – 为人类和代理设计的全栈 Python 框架
Show HN: Plain – The full-stack Python framework designed for humans and agents

原始链接: https://github.com/dropseed/plain

Plain是一个专为人类开发者和AI代理设计的全栈Python Web框架。它优先考虑明确性、类型标注和可预测性,旨在创建易于双方理解的代码。 设置简单:一条命令即可启动项目创建。Plain采用清晰、结构化的代码风格,使用基于类的视图和Router类进行URL管理。它内置了可通过斜杠命令触发的“技能”访问的工具,可自动化诸如包安装、升级、优化和错误报告等任务。 主要特性包括始终开启的护栏(“Rules”)、全面的按需文档以及由`uv`、`ruff`和`pytest`等工具提供支持的强大开发工具集(linting、测试等)。 Plain基于Python 3.13+、Postgres、Jinja2、htmx和Tailwind CSS构建,是Django的一个分支,为AI代理时代而重新设计,并简化为30个第一方包。

黑客新闻 新的 | 过去的 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 Show HN: Plain – 为人类和代理设计的全栈 Python 框架 (github.com/dropseed) 14 分,由 focom 1 小时前发布 | 隐藏 | 过去的 | 收藏 | 讨论 帮助 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系方式 搜索:
相关文章

原文

The full-stack Python framework designed for humans and agents.

mkdir my-app && cd my-app && claude "$(curl -sSf https://plainframework.com/start.md)"

Also works with Codex, Amp, OpenCode, or your agent of choice.

Explicit, typed, and predictable. What's good for humans is good for agents.

Here's what Plain code looks like:

# app/users/models.py
from plain import postgres
from plain.postgres import types
from plain.passwords.models import PasswordField

@postgres.register_model
class User(postgres.Model):
    email: str = types.EmailField()
    password: str = PasswordField()
    display_name: str = types.CharField(max_length=100)
    is_admin: bool = types.BooleanField(default=False)
    created_at: datetime = types.DateTimeField(auto_now_add=True)

    query: postgres.QuerySet[User] = postgres.QuerySet()

    model_options = postgres.Options(
        constraints=[
            postgres.UniqueConstraint(fields=["email"], name="unique_email"),
        ],
    )

Views are class-based:

# app/users/views.py
from plain.views import DetailView
from .models import User

class UserDetail(DetailView):
    template_name = "users/detail.html"

    def get_object(self):
        return User.query.get(pk=self.url_kwargs["pk"])

URLs use a Router class:

# app/users/urls.py
from plain.urls import Router, path
from . import views

class UsersRouter(Router):
    namespace = "users"
    urls = [
        path("<int:pk>/", views.UserDetail),
    ]

Plain projects include built-in tooling that agents use automatically.

Rules — Always-on guardrails stored in project rules files (e.g. .claude/rules/ for Claude Code). Short files (~50 lines) that prevent the most common mistakes.

Docs — Full framework documentation, accessible on demand from the command line:

plain docs models                      # full docs
plain docs models --section querying   # one section
plain docs models --api                # typed signatures only
plain docs --search "queryset"         # search across all packages

Skills — End-to-end workflows triggered by slash commands:

  • /plain-install — add a new package and walk through setup
  • /plain-upgrade — bump versions, read changelogs, apply breaking changes, run checks
  • /plain-optimize — capture performance traces, identify slow queries and N+1 problems, apply fixes
  • /plain-bug — collect context and submit a bug report as a GitHub issue

All commands run with uv run (e.g. uv run plain dev).

  • plain dev — start dev server with auto-reload and HTTPS
  • plain fix — format and lint Python, CSS, and JS in one command
  • plain check — linting, preflight, migration, and test validation
  • plain test — run tests (pytest)
  • plain docs --api — public API surface, formatted for LLMs

Plain is opinionated. These are the technologies it's built on:

  • Python: 3.13+
  • Database: Postgres
  • Templates: Jinja2
  • Frontend: htmx, Tailwind CSS
  • Python tooling: uv (packages), ruff (lint/format), ty (type checking) — all from Astral
  • JavaScript tooling: oxc (lint/format), esbuild (bundling)
  • Testing: pytest

30 first-party packages, one framework. All with built-in docs.

Foundation:

Backend:

Frontend:

Development:

Production:

Users:

Plain is a fork of Django, driven by ongoing development at PullApprove — with the freedom to reimagine it for the agentic era.

联系我们 contact @ memedata.com