🔶 CMS with AI,而非 AI CMS:Wagtail 8.0 的新 API
英文标题:🔶 CMS with AI, Not AI CMS: Wagtail 8.0's New API
Wagtail 8.0 以预览形式推出 v3 API,覆盖页面、图片、文档等 50 多项后台操作,并提供自动生成 OpenAPI schema 的完整类型化文档。该 API 原生支持将富文本作为 Markdown 处理,同时可为自定义 Django 模型提供端点,并兼顾公开访问与基于 Bearer Token 和 Wagtail 权限模型的私有数据访问。Wagtail 强调“CMS with AI, not AI CMS”,不会默认在后台植入 AI 功能,但新 API 可通过 curl、CLI 或 MCP 供各类 Agent 调用。对开发者而言,这意味着可用脚本或 LLM Agent 加速内容发布、批量 SEO 优化、内容清理与跨系统迁移等工作流。
12.6 KB
37.1 KB
77.8 KB
62.7 KB
中文
由此你将获得:
- 覆盖页面、图片、文档等众多资源的 50 多项后台操作。
- 完整文档化且具备类型定义的 API,并自动生成 OpenAPI schema。
- 内置支持将富文本作为 Markdown 使用,既适合个人偏好,也适合 Agent。
- 面向你自有 Django 模型的 API 端点,适用于将 Wagtail 作为 Django admin 替代方案的用户。
此外,你还将获得精美的 API 文档:

这得益于一部分黑魔法、一部分由 ty 检查的类型提示,以及经由 Django Ninja 🥷 和 Pydantic 处理的能力。
它支持公开 / 匿名访问,因此无头网站及其他发布机制可以从 v2 API 迁移过来。对于私有数据,则通过 Bearer Token 身份验证和 Wagtail 的权限模型加以保护。
更高灵活性,更快节奏
部分用户希望通过精心编排的自动化与人工内容审核,将质量调到 11;另一些用户则只希望最终稿能够复制粘贴后直接上线,且不出差错。我们希望同时支持这些高级 以及 加速的工作流,因此构建出一种“选择你自己的冒险”式后台 / 内容操作框架。你可以继续只使用后台 UI,也可以完全使用 API;或者按具体情况混合使用:针对某些页面,利用后台必要的操作阻力来促进更高质量;对于批量 SEO 改进,则使用脚本化 API。
例如,以下是要求 OpenCode 修复某个页面搜索描述的示例:

这里使用的是运行在 TensorX 中的 DeepSeek V4 Flash,但任何 Agent 都能够支持这一功能!
CMS with AI,而非 AI CMS
这也是贯彻我们的 AI 指导原则的一部分。除非你决定安装 Wagtail AI,否则后台中不会出现任何 ✨ 魔法闪光 ✨ AI 按钮。但如果你希望获得更多 Agent 式协助,现在可以实现了。无论是直接使用 curl、通过 CLI,还是通过 MCP,新的 v3 API 操作都非常适合 Agent。
如果你更偏好确定性的操作,常见任务的脚本化也比以往更近一步!我个人非常期待借助 LLM 编写小型客户端 / 脚本,以便实现:
- 更快地发布我以 Markdown 写成的文章。
- 获取所有未发布页面和未使用图片的报告,以便清理。
- 通用内容导入器:用一个 100 行的脚本在系统之间迁移内容,而不是耗费数周时间。
试用 API
如果你想轻松试用,以下是可选方式:
- 获取我们的官方演示项目副本,其中已完成全部配置,并按照 API 演示说明操作。
- 在限定时间内,可在这个共享演示站点中试用:wagtaildemo-ai,使用此 Token:wagtail_DImkbqbcAZhenzuG0RgnYj3jP700qIYRu。
- 试用我们指南网站上的公开操作。
需要反馈
开始使用 API,并告诉我们你希望用它做什么、已经做了什么、哪些功能有效、哪些不够好!我们将在 Wagtail 8.0 中以预览版形式发布它,以便在几周后发布 v8.1 前,根据反馈进行调整。欢迎加入 GitHub 上的反馈讨论,即使只是分享你的想法。
此外,别忘了报名并为 Wagtail Space 2026 提交演讲提案,让我们共同看看大家利用平台这项新能力构建了什么!
English / 原文
From this, you get:
- 50+ admin operations across pages, images, documents, and many more.
- A fully documented and typed API , with auto-generated Open API schema.
- Built-in support for rich text as Markdown. For personal preference, and agents.
- API endpoints for your own Django models , for those who use Wagtail as a Django admin alternative.
Oh and, you also get beautiful API docs on top:

This is possible with part dark magic, part type hints checked with ty and processed with Django Ninja 🥷 and Pydantic.
It comes with public / anonymous access so headless sites and other publication mechanisms can transition off the v2 API. And for private data, it’s protected with bearer token auth and Wagtail’s permissions model.
More flexibility, faster pace
Some of our users want to dial up the quality to 11 with carefully choreographed automated and manual content reviews, some just want their final draft copy-pasted and live without mistakes. We want to support those advanced and sped-up workflows, so we arrive at a kind of "choose your own adventure " admin / content operations framework. You can keep using only the admin UI, or go API only. Or case-by-case; use the (necessary) friction of an admin that encourages higher quality for some pages. Do bulk SEO improvements with a scripted API.
For example, here’s what it looks like to ask OpenCode to fix a page’s search description:

This is with DeepSeek V4 Flash running in TensorX, but any agent will support this!
CMS with AI, not AI CMS
This is all part of working within our AI guiding principles. There won’t be any ✨ magic sparkles ✨ AI buttons in your admin unless you decide to install Wagtail AI. But if you want more agentic help, now you can. The new v3 API operations are ideal for agents, whether used directly with curl, via a CLI, or via MCP.
And if you prefer more deterministic operations, scripting of common tasks is closer than ever! Personally I’m really looking forward to writing little clients / scripts with LLMs to help with:
- Faster publication of articles I wrote in Markdown.
- Getting a report of all unpublished pages and unused images to clean up.
- Generic content importers, moving content between systems with a 100-line script rather than weeks of work.
Demo the API
Here are the options if you want to try this out easily:
- Get a copy of our official demo, with everything set up, and follow the API demo instructions.
- For a limited time - try it out in this shared demo site: wagtaildemo-ai, with this token: wagtail_DImkbqbcAZhenzuG0RgnYj3jP700qIYRu.
- Try out the public operations on our guide website.
Feedback needed
Start using the API and tell us what you want to do with it, what you did, what works, what doesn’t! We’re releasing it as a preview in Wagtail 8.0, so we can adapt it based on feedback ahead of v8.1 in a few weeks. Join the feedback discussion in GitHub, even if just to share your ideas.
And make sure to sign up and propose talks for Wagtail Space 2026, so we can all see what everyone has been building with this new capability in our platform!