首页 > 解决方案 > Wagtail:如何在 REST API v2 上公开 wagtail 片段

问题描述

我创建了一堆 wagtail 片段,并且我已经设置了 wagtail 拥有的 REST API V2。但我不确定如何在端点上公开每个片段。我不想使用页面,因为我不需要它们。我只需要能够在 API 中公开这些片段。那可能吗?我想存档这样的东西:

http://localhost:8000/api/v2/my-snippet-model/

并且还可以添加过滤器。

谢谢!

标签: pythondjangodjango-rest-frameworkwagtailwagtail-snippet

解决方案


推荐阅读