-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enabling Wagtail v2 API (Headless CMS)
- Loading branch information
1 parent
f942392
commit 8988bd8
Showing
3 changed files
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from wagtail.api.v2.endpoints import PagesAPIEndpoint | ||
from wagtail.api.v2.router import WagtailAPIRouter | ||
from wagtail.images.api.v2.endpoints import ImagesAPIEndpoint | ||
from wagtail.documents.api.v2.endpoints import DocumentsAPIEndpoint | ||
|
||
api_router = WagtailAPIRouter('wagtailapi') | ||
|
||
api_router.register_endpoint('pages', PagesAPIEndpoint) | ||
api_router.register_endpoint('images', ImagesAPIEndpoint) | ||
api_router.register_endpoint('documents', DocumentsAPIEndpoint) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8988bd8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tutorial: https://learnwagtail.com/tutorials/how-to-enable-the-v2-api-to-create-a-headless-cms/
YouTube Video: https://youtu.be/VT9-qdI96rE