Plugins

Djedi CMS plugins handles content serialization and rendering.

Enable plugins

Each plugin has its own extension which is referred to in the request URI. Enable plugins by adding the the full class path to the PLUGINS djedi setting.

Default settings:

DJEDI_PLUGINS = (
    'cio.plugins.txt.TextPlugin',
    'cio.plugins.md.MarkdownPlugin',
    'djedi.plugins.img.ImagePlugin',
)

Built-in plugins

Djedi CMS comes with tre built-in plugins; text, markdown and image.

Text Plugin

Plugin:cio.plugins.txt.TextPlugin
Extension:txt
Dependencies:none

The text plugin is a plugin in its simplest form, not modifying the content either when persisting or rendering.


Markdown Plugin

Plugin:cio.plugins.md.MarkdownPlugin
Extension:md
Dependencies:Markdown

The markdown plugin depends on the Markdown python package. It renders persisted markdown syntax as html.

$ pip install Markdown

Image Plugin

Plugin:djedi.plugins.img.ImagePlugin
Extension:img
Dependencies:PIL

The image plugin handles drag and drop image uploads, cropping, resizing and rendering html image tags. It depends on the python imaging library, and it’s recommended that you use the more up-to-date Pillow fork.

$ pip install Pillow

Uploaded images gets persisted using Django’s file storage api. If you don’t want to use the default file storage, you can configure the image plugin setting FILE_STORAGE.

# settings.py

DJEDI = {
    'IMG': {
        'FILE_STORAGE': my_file_storage
    }
}

Table Of Contents

Related Topics

This Page