c52e3a3ff59d5be2f0ed3a24a8b29508f4461f72
所有 Page 模型(SEOablePage 及其子类 HomePage/BlogPage/BlogIndexPage/ ProductPage/CaseStudyPage/SolutionPage)此前均未声明 api_fields,导致 前端 fields=body,seo_title_override,... 等请求被 Wagtail API v2 拒绝并 返回 400(Wagtail 默认只暴露 id/meta/title,其余字段必须显式加入 api_fields 才能通过 ?fields= 查询)。这正是生产环境首页显示"尚未连接到 Wagtail CMS"的根因。 - apps/core/models.py: SEOablePage 增加 api_fields(seo_title_override/ seo_description_override);SimpleContentPage 追加 body - apps/home/models.py: HomePage 追加 body - apps/blog/models.py: BlogIndexPage 追加 intro;BlogPage 追加 published_at/intro/body - apps/products/models.py: ProductPage 追加 summary/body - apps/cases/models.py: CaseStudyPage 追加 client_name/industry/ published_at/summary/body - apps/solutions/models.py: SolutionPage 追加 industry/summary/body api_fields 是纯 Wagtail 类属性,不是 Django 模型字段,因此不产生新的 migration(makemigrations --check 确认 No changes detected)。 验证:pytest 67 个用例全部通过;manage.py check 无新增错误(仅已知 treebeard.E001 警告)。
Description
No description provided
4.6 MiB
Languages
Python
90.4%
HTML
6.9%
PowerShell
1.6%
Dockerfile
0.9%
Shell
0.2%