Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Wagtailmedium is a Medium Editor integration for the Wagtail CMS.

Project Description

Wagtailmedium is a Medium Editor integration for the Wagtail CMS.

Note: A more detailed documentation is available in .codestory format, along with a sample project to fiddle with.


  1. Install from pip:

    pip install django-wagtailmedium
  2. Add wagtailmedium to your apps:


3. Add a wagtailmedium widget to ``WAGTAILADMIN_RICH_TEXT_EDITORS`` (implemented by wagtail, undocumented yet)

     'default': {
         'WIDGET': 'wagtail.wagtailadmin.rich_text.HalloRichTextArea'
     'medium': {
         'WIDGET': 'wagtailmedium.rich_text.MediumRichTextArea',
         'OPTIONS': {
             'custom_buttons': {
                 'code': {
                   'contentDefault': '<b>Code</b>',
                   'contentFA': '<i class="fa fa-code"></i>',
                   'tag': 'code',
                   'className': 'code',  # optional
                 'test': {
                     'contentDefault': '<b>Test</b>',
                     'contentFA': '<i class="fa fa-code"></i>',
                     'tag': 'span',
                     'className': 'test',  # optional
             'medium': {  #
                 # 'buttonLabels': 'fontawesome',
                 'toolbar': {
                     'buttons': [  #
                         'bold', 'italic', 'underline',
                         'h2', 'h3', 'orderedlist', 'unorderedlist', 'strikethrough'
  1. Register whitelister element rules

This wagtail hook defines which HTML elements are allowed in rich text areas.

from wagtail.wagtailcore import hooks
from wagtail.wagtailcore.whitelist import attribute_rule, allow_without_attributes

@hooks.register('construct_whitelister_element_rules')  # #7bFcf#
def whitelister_element_rules():
    return {
        'u': allow_without_attributes,
        'span': attribute_rule({'class': True}),
        'code': allow_without_attributes,
        'blockquote': allow_without_attributes,
  1. Use wagtailmedium in a RichTextField of your model

from wagtail.wagtailcore.models import Page, StreamField, RichTextField

class HomePage(Page):
    # a default, Hallo editor
    hallo = RichTextField(blank=True)
    # a medium editor
    medium = RichTextField(editor='medium', blank=True)
Release History

Release History

This version
History Node


Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django_wagtailmedium-0.1.tar.gz (811.9 kB) Copy SHA256 Checksum SHA256 Source May 19, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting