Рет қаралды 10,333
In this video, we enable Wagtails powerful Headless CMS (v2 API) by writing just 12 lines of code.
Wagtail comes with a lot of really powerful features. Many features are not enabled by default as to keep your site running quickly and efficiently. One of those amazing features is the Wagtail v2 API, which can return any page, image, document, orderable and StreamField as a JSON response for your SPA/PWA to consume.
To test your API endpoint, you can open your Browsers Console (right click - inspect - console) and type in this JavaScript, which will make a request to your main Pages listing view:
gist.github.com/KalobTaulien/... (I wasn't allowed to paste the raw code, but here's the Gist)
Tutorial: learnwagtail.com/tutorials/ho...
Git Commit: github.com/CodingForEverybody...
Learn Wagtail from scratch with the official Wagtail for Beginners Course
learnwagtail.com/wagtail-for-...
Used in this video: Wagtail 2.4, Python 3.7, Django 2.1.5 #Wagtail #Django #Python