Skip to main content

wagtailnews

A plugin for Wagtail that provides news / blogging functionality.

Installing

Install using pip:

pip install wagtailnews

It works with Wagtail 5.2 and upwards. For older versions of Wagtail see past releases.

Quick start

Create news models for your application that inherit from the relevant wagtailnews models:

from django.db import models

from wagtail.admin.panels import FieldPanel
from wagtail.fields import RichTextField
from wagtail.models import Page

from wagtailnews.models import NewsIndexMixin, AbstractNewsItem, AbstractNewsItemRevision
from wagtailnews.decorators import newsindex


# The decorator registers this model as a news index
@newsindex
class NewsIndex(NewsIndexMixin, Page):
    # Add extra fields here, as in a normal Wagtail Page class, if required
    newsitem_model = 'NewsItem'

    featured_news_item = models.ForeignKey(
        'NewsItem',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+',
    )

    content_panels = Page.content_panels + [
        FieldPanel('featured_news_item'), # This will set up a chooser for selecting a news item
    ]


class NewsItem(AbstractNewsItem):
    # NewsItem is a normal Django model, *not* a Wagtail Page.
    # Add any fields required for your page.
    # It already has ``date`` field, and a link to its parent ``NewsIndex`` Page
    title = models.CharField(max_length=255)
    body = RichTextField()

    panels = [
        FieldPanel('title', classname='full title'),
        FieldPanel('body', classname='full'),
    ] + AbstractNewsItem.panels

    def __str__(self):
        return self.title


class NewsItemRevision(AbstractNewsItemRevision):
    newsitem = models.ForeignKey(NewsItem, related_name='revisions', on_delete=models.CASCADE)

Old docs

The docs for Wagtail news are severely out of date, but may still be useful for reference.

Metadata

Release files for wagtailnews 5.2.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 wagtailnews 5.2.0
File Size Uploaded Provenance
wagtailnews-5.2.0.tar.gz 26.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for wagtailnews 5.2.0
File Interpreter ABI Platform
wagtailnews-5.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 57.5 kB

Release files / wagtailnews-5.2.0.tar.gz

Download URL wagtailnews-5.2.0.tar.gz
Size 26.4 kB
Tags Source
SHA-256 checksum
How to use checksums
75e5be8743a76eba2d2671e993494d1c36f61258066968acdc595a681607b5fb
BLAKE2b-256 checksum
How to use checksums
634f45044671542d60f58e1dfc0fdfc255cbe5811345b09001b0f3dbcd7f18bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / wagtailnews-5.2.0-py3-none-any.whl

Download URL wagtailnews-5.2.0-py3-none-any.whl
Size 31.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f5d58d8046463b9679361f3ea1ee12ee6493e4956dfee579f084d168eb62a4f0
BLAKE2b-256 checksum
How to use checksums
754be4adb8b92679c07a514e7d7770356c0aa234ff55b050822574c8f87ebc32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Security for wagtailnews 5.2.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

5.2.0 This release

2 release files No 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