Questions tagged [wagtail-apiv2]

The Wagtail API V2 module exposes a public, read-only, JSON-formatted API which can be used by external clients (such as a mobile app) or the site's frontend. The API is built on Django REST Framework and comes on as a dependency of Wagtail.

The Wagtail API V2 module exposes a public, read-only, JSON-formatted API which can be used by external clients (such as a mobile app) or the site's frontend. The API is built on Django REST Framework and comes on as a dependency of Wagtail.

Please consider official document for more details.

26 questions
2
votes
1 answer

How can I use Wagtail Forms for a Headless CMS? ( without Template )

According to the documentation, Wagtail API is read-only ( POST Method not allowed ). Hence, the only way to use Forms from the Sidebar Menu is using Templates, so the client is capable of making post requests against the API internaly. But that´s…
Paul
  • 35
  • 6
1
vote
0 answers

Wagtail filter by related model field in PagesAPIViewSet

I have EntryPage model that have M2M relation to Category (categories field name). I've added viewset for Entries: class EntriesViewSet(PagesAPIViewSet): base_serializer_class = EntryPageWithSiblingsSerializer model = EntryPage …
1
vote
2 answers

How to serialize a list of non model/queryset objects

I am looking for a proper way to be able to pass a manually created list of objects to Wagtail API. The list is coming from an imported function which simply generates the following list. List (not a queryset or model instance) data = […
1
vote
0 answers

Wagtail - DRF Response() instead of JsonResponse()

I'm using Wagtail as a headless CMS / API, however instead of using the PagesAPIViewSet I've gone the route of overriding the serve() method as described here to fetch…
Thorvald
  • 546
  • 6
  • 18
1
vote
1 answer

filtering ParentalManyToManyField by query param in wagtail API

I have a wagtail Page model like: class PropertyPage(Page): ... categories = ParentalManyToManyField('property.PropertyCategory', blank=True) Is it possible to have a query param to filter multiple values base on…
ogholami
  • 31
  • 1
  • 8
1
vote
1 answer

wagtail API and pagination

I got index pages that shows subpages as items. I added a property and a serializer.field to return the json data in my page. So far so good. But child pages can be 100+ so I added a paginator on my the queryset and and a filter for some tags. My…
Enquest
  • 91
  • 2
  • 9
1
vote
1 answer

How to integrate ReactJS application with Wagtail API. Steps to follow?

I am trying the write application in ReactJS and backend will be using Wagtail API. I am trying to find out what all steps/what all configuration needs to be done on front end side as well on backend to integrate ReactJS with the Wagtail?
1
vote
2 answers

Wagtail API v2 django.template.exceptions.TemplateDoesNotExist

I have configured Wagtail API as prescribed in the docs and it works nicely when using curl: $ curl -LsD- http://127.0.0.1:8080/rest/p/ HTTP/1.1 200 OK Date: Fri, 22 May 2020 17:33:58 GMT Server: WSGIServer/0.2 CPython/3.8.2 Content-Type:…
NarūnasK
  • 4,564
  • 8
  • 50
  • 76
1
vote
1 answer

Retrieve all children of Base page type

I'm working on a Wagtail app which has a number of different page types RawHTMLLandingPage, MarketingLandingPage, etc. which are children of a base page, LandingPageBase. If I understand correctly, a child page type knows what type it's parent is.…
commadelimited
  • 5,656
  • 6
  • 41
  • 77
1
vote
1 answer

Include a custom field in every Wagtail API response

My company is running Wagtail headless, using only the API, to power parts of an existing web intranet. We'd like to include a customized "edit bar" at the top of every page in the main web application, which points to the "edit" page of the…
commadelimited
  • 5,656
  • 6
  • 41
  • 77
1
vote
1 answer

Filtering on fields doesn't apply the actual fitler set

Extending the BaseAPIEndpoint on a custom page model exposes its pages through the api, which is great, however, when I try to apply a field filter, it is not applied, and the response returns all pages regardless. The documentation has no mention…
glls
  • 2,325
  • 1
  • 22
  • 39
0
votes
0 answers

Wagtail: How to use preview on editors page without Django templates?

I started to use Wagtail with the v2 rest endpoint and do not understand how to implement the preview. I use Nuxt as a frontend and can not find how to integrate previewing on the page editor in Wagtail admin. Is this not possible/supported at the…
Philipp S.
  • 827
  • 17
  • 41
0
votes
1 answer

Wagtail fields not showing up in pages list response

Im using Wagtail with django and I'm following the tutorial. I've got a BlogPage like so: class BlogPage(Page): date = models.DateField("Post date") intro = models.CharField(max_length=250) body = RichTextField(blank=True) # Add…
meg hidey
  • 192
  • 4
  • 15
0
votes
1 answer

How can I change `embed` element for `img` element in rich text image Wagtail API response?

I'm using the Wagtail API to retrieve data of the pages from my site. The problem I'm having is that when there is an image inside a rich text block and I retrieve it using the API, the body attribute has the shape: "body": [ { …
0
votes
0 answers

Unable to get formFields from callable ChoiceBlock in StreamField

Unable to get formFields from callable ChoiceBlock in StreamField I was using a ChooserBlock to get Forms in a dropdown list in a StreamField on my page but now I am upgrading my wagtail version from 3.0 to 4.0.4 in which I refered that ChooserBlock…
1
2