Skip to main content

Wagtail StreamField presets

Give your editors a head start: ready-made sets of blocks they can load into a StreamField and fill in.

Most pages on a site follow a pattern. A landing page is a hero, a few sections and a call to action. A recipe is an introduction, a photo, the ingredients and the method. Without presets, editors rebuild that pattern block by block on every new page.

With presets, an editor picks one from the list above the field and presses Load. The blocks appear, ready to fill in, so the editor's time goes on the words instead of the layout.

An editor opens the preset list above a StreamField, chooses Recipe, presses Load, and the recipe's blocks fill the field

  • Fills the field in the browser. Nothing reloads, so the title and every other field keep what the editor typed.
  • Asks before replacing. If the field already has blocks, the editor confirms first; nothing is saved until the page is.
  • Declared in code, next to the blocks. A preset is a function that returns blocks, so it can start with real content from your database, such as an image from the library.
  • A plain StreamBlock everywhere but the editor. Rendering, storage, validation and migrations are unchanged, so an existing stream can adopt it without touching its data.

Supported versions

Wagtail 7.4 and up, and all compatible versions of Python and Django: Python 3.11+ and Django 5.2+.

Installation

Pick the command for your preferred package installer:

uv add wagtail-streamfield-presets
poetry add wagtail-streamfield-presets
pip install wagtail-streamfield-presets

Then add the app to INSTALLED_APPS:

INSTALLED_APPS = [
    # ...
    "wagtail_streamfield_presets",
]

No template or URL wiring is needed. The picker's script and stylesheet travel with the field's own editor media.

Usage

Subclass PresetStreamBlock instead of StreamBlock, and declare presets in its Meta:

from wagtail import blocks
from wagtail.rich_text import RichText
from wagtail_streamfield_presets.blocks import Preset, PresetStreamBlock


def article_outline():
    return [
        ("heading", "[Title]"),
        ("paragraph", RichText("<p>[Opening paragraph]</p>")),
    ]


class ArticleStream(PresetStreamBlock):
    heading = blocks.CharBlock()
    paragraph = blocks.RichTextBlock()

    class Meta:
        presets = [Preset("outline", "Article outline", article_outline)]

Use it like any StreamBlock: body = StreamField(ArticleStream()). Editors now see Start from a preset above the field.

Presets belong in Meta, not in the block's constructor arguments: Wagtail writes those into migrations, and a preset holds a function. Kept in Meta, editing a preset never needs a migration.

The documentation has a tutorial, how-to guides and the full reference.

License

BSD-3-Clause.

Metadata

Release files for wagtail-streamfield-presets 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wagtail-streamfield-presets 0.1.0
File Size Uploaded Provenance
wagtail_streamfield_presets-0.1.0.tar.gz 7.1 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for wagtail-streamfield-presets 0.1.0
File Interpreter ABI Platform
wagtail_streamfield_presets-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.0 kB

Release files / wagtail_streamfield_presets-0.1.0.tar.gz

Download URL wagtail_streamfield_presets-0.1.0.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9d760f1e56975b412b301fd26f1e8025ed4d1a6de66f939238a56ef89c5b69da
BLAKE2b-256 checksum
How to use checksums
cb9dcce49c0a3f8d450a9f86b88f7ca643c2f1be1b28993d30f74a22bebb57f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / wagtail_streamfield_presets-0.1.0-py3-none-any.whl

Download URL wagtail_streamfield_presets-0.1.0-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9c90456984fff56de0b483d997209151a335855b6819a5d001d7c2f7c5d9c5c0
BLAKE2b-256 checksum
How to use checksums
cd0ca79412289ef9c785a59ecbbeab57d9ee0fcdaa49e72e7fc815a2a6ffd3ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Security for wagtail-streamfield-presets 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for wagtail_streamfield_presets-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page