News / blog plugin for the Wagtail CMS
A plugin for Wagtail that provides news / blogging functionality.
Install using pip:
pip install wagtailnews
It works with Wagtail 2.3 and upwards. For older versions of Wagtail see past releases.
Documentation for Wagtail news can be found on Read The Docs
Create news models for your application that inherit from the relevant wagtailnews models:
from django.db import models from wagtail.admin.edit_handlers import FieldPanel from wagtail.core.fields import RichTextField from wagtail.core.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' 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')
Release history Release notifications
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size wagtailnews-2.3.0-py3-none-any.whl (29.7 kB)||File type Wheel||Python version 3.7||Upload date||Hashes View hashes|
Hashes for wagtailnews-2.3.0-py3-none-any.whl