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!

Restructured Text plugin for Django CMS.

Project Description

A plugin for Django CMS, which renders restructured text into html, using docutils.


Install cmsplugin_rst using pip or your favorite method, using a virtualenv or not.

$ pip install cmsplugin_rst

Add 'cmsplugin_rst' to your INSTALLED_APPS, in your django settings.

And then migrate the DB:

$ python migrate

Beware, if you upgrade from cmsplugin_rst v0.1.1, which didn’t use django migrations but South, you may have to skip the initial migration (eg. if you get the “OperationalError: table “cmsplugin_rst_rstpluginmodel” already exists” error):

$ python migrate –fake-initial cmsplugin_rst

To speed up the (potentially heavy) rendering of cmsplugin_rst plugins, consider using the cache framework of django.


The behaviour of cmsplugin_rst can be tweaked with these Django settings (all are optional).

The plugin disallows, by default, insecure features like *file insertions* and *raw* directive, in the restructured text renderer.

Name of the docutils writer to be used for rendering HTML (default: “html4css1”)
A restructuredtext string wich will be prepended to all your RST plugin contents, before rendering. Useful to define replacement blocks, custom roles, etc.
A restructuredtext string wich will be appended to all your RST plugin contents, before rendering.
A dict of settings which will be merged over plugin defaults, and passed to the docutils renderer. See docutils publish_parts() and its settings_overrides parameter ( Amongst interesting settings are “initial_header_level” and “report_level”.
If and only if BeautifulSoup is installed, these postprocessors are applied to the rendered HTML before displaying it. It must be a list of qualified function names, eg. [“mymodule.mysubmodule.myfunction”]. Each of these functions must expect a beautifulsoup tree as unique argument, and modify it in-place.

Specific Roles and Replacements

The restructured text is not evaluated by the django template engine, so you can’t use django/djangocms tags and filters.

But some specific replacements take place:

  • {{ MEDIA_URL }} and {{ STATIC_URL }} tags are replaced, before html rendering, by corresponding django settings.
  • {{ BR }} and {{ NBSP }} are replaced, after html rendering, by corresponding html tags/entities.

Additionally, you can create links to other CMS pages with the custom “cmspage” role provided, using the “reverse IDs” that you’ll have set previously in advanced page parameters:

:cmspage:`My-Reverse-Id`   // the menu title will be use as the link name

:cmspage:`My Link Name <My-Reverse-Id>`   // here the link name is embedded in role

Reverse IDs must exist and be unique in the djangocms DB, else the rendering of the link fails.

Test Project

A demo project with a sqlite DB is included in repository, as a git submodule (

Its django admin credentials are test/test.

Release History

Release History

This version
History Node


History Node


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
cmsplugin-rst-0.2.tar.gz (7.1 kB) Copy SHA256 Checksum SHA256 Source Jul 3, 2016 (11.6 kB) Copy SHA256 Checksum SHA256 Source Jul 3, 2016

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