Skip to main content

A read/write REST API for Wagtail CMS

Project description

wagtail-write-api

A read/write REST API for Wagtail CMS, built on Django Ninja.

Wagtail's built-in API is read-only, designed for headless frontends. This plugin adds full content management: create, edit, publish, and delete pages and images via a REST API with automatic OpenAPI documentation.

Documentation

Features

  • Page CRUD with draft/publish workflow, revision history, copy, and move
  • Image management with multipart upload and configurable renditions
  • StreamField read/write with full round-trip fidelity
  • Rich text input in Markdown, HTML, or Wagtail's internal format
  • Schema discovery so clients can inspect page types and their fields
  • Wagtail permissions enforced exactly as in the admin
  • OpenAPI docs generated automatically from Pydantic schemas

Quick start

pip install wagtail-write-api
# settings.py
INSTALLED_APPS = [
    ...
    "rest_framework",
    "rest_framework.authtoken",
    "wagtail_write_api",
]
# urls.py
urlpatterns = [
    path("api/write/v1/", include("wagtail_write_api.urls")),
    ...
]

Create a token and start using the API:

python manage.py drf_create_token admin
curl -H "Authorization: Bearer <token>" http://localhost:8000/api/write/v1/pages/

Interactive API docs are served at /api/write/v1/docs.

Requirements

  • Python 3.10+
  • Wagtail 6.0+
  • Django REST Framework (for token auth)

Documentation

Full documentation is at tomdyson.github.io/wagtail-write-api, covering:

Development

git clone https://github.com/tomdyson/wagtail-write-api.git
cd wagtail-write-api
uv venv && uv pip install -e ".[dev]"
uv run pytest

Run the example app:

cd example
uv run python manage.py migrate
uv run python manage.py seed_demo
uv run python manage.py runserver

Releasing to PyPI

  1. Update the version in pyproject.toml and src/wagtail_write_api/__init__.py
  2. Build: uv build
  3. Publish: uv publish --token pypi-YOUR_TOKEN

Licence

BSD 3-Clause. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wagtail_write_api-0.1.1.tar.gz (109.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wagtail_write_api-0.1.1-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file wagtail_write_api-0.1.1.tar.gz.

File metadata

  • Download URL: wagtail_write_api-0.1.1.tar.gz
  • Upload date:
  • Size: 109.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for wagtail_write_api-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f74ae65352aa525d33f40a11415f629da5994e9961f28470fed35057bfb2ed17
MD5 79e1ce08d61fad2da32bf142b04dd5f7
BLAKE2b-256 3e66349dbb2b6682b1a997b38ce64ac5cc1782a2026557f88387638731f6d9a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for wagtail_write_api-0.1.1.tar.gz:

Publisher: publish.yml on tomdyson/wagtail-write-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wagtail_write_api-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for wagtail_write_api-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ac1e9da335303c5084d9aa63234b8fb7820c6ececc8c89269c9b0369ef2a5414
MD5 53a6fca29aecd5631519a871d2280a10
BLAKE2b-256 592644cd9d2cb38fcdf744f7c18f5236c3968645ae2e1874e25f97452be49817

See more details on using hashes here.

Provenance

The following attestation bundles were made for wagtail_write_api-0.1.1-py3-none-any.whl:

Publisher: publish.yml on tomdyson/wagtail-write-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page