Skip to main content

News / blog plugin for the Wagtail CMS

Project description

A plugin for Wagtail that provides news / blogging functionality.

Installing

Install using pip:

pip install wagtailnews

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

Documentation

Documentation for Wagtail news can be found on Read The Docs

Quick start

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')

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

wagtailnews-2.7.1.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

wagtailnews-2.7.1-py3-none-any.whl (29.8 kB view details)

Uploaded Python 3

File details

Details for the file wagtailnews-2.7.1.tar.gz.

File metadata

  • Download URL: wagtailnews-2.7.1.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/33.1.1 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.5.3

File hashes

Hashes for wagtailnews-2.7.1.tar.gz
Algorithm Hash digest
SHA256 72a14a9b5e0e566a513449663893c3bbe08e5fee77a9c3e414c06a38642ae778
MD5 70bd76998c7f92993bf51f3b0186540a
BLAKE2b-256 77a1618b926d1a498e472ca95997b345d7d3bf316f75191e037af15d42c8c862

See more details on using hashes here.

File details

Details for the file wagtailnews-2.7.1-py3-none-any.whl.

File metadata

  • Download URL: wagtailnews-2.7.1-py3-none-any.whl
  • Upload date:
  • Size: 29.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/33.1.1 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.5.3

File hashes

Hashes for wagtailnews-2.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 faec96f16ef0f86eb84bfc09b04a154bf5362cc0e9a08d7c91dc4899ab93e055
MD5 ee9f6e7b5b4853f3faf007b2ff21fc21
BLAKE2b-256 c7744f270efd475ff8bc51899325ad0ac9a8998e770a7f6dc5e2f9b5e0b1566c

See more details on using hashes here.

Supported by

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