• To install django-markupmirror, use pip (or easy_install or simply python install from source) and add 'markupmirror' to the INSTALLED_APPS in your Django project.

    $ pip install django-markupmirror
  • In your specify at least MARKUPMIRROR_DEFAULT_MARKUP_TYPE which is 'plaintext' by default.

  • For the markup HTML-preview, you’ll need to add markupmirror’s URLs in your URLconf. In your add:

    import markupmirror.urls
    urlpatterns = patterns('',
        (r'^markupmirror/', include(markupmirror.urls.preview)),


django-markupmirror depends on:

  • Django 1.4+ (for now tested with 1.4 only), obviously.
  • FeinCMS 1.5+ (for now tested with 1.5.3 and 1.6.2 only), if you want to use the page content-type.
  • Markdown 2.1+, if you want to use the MarkdownMarkup converter.
  • Docutils 0.8+, if you want to use the ReStructuredTextMarkup converter.
  • Textile 2.1+, if you want to use the TextileMarkup converter.

The three latter will be available automatically if the respective dependencies are met.

Settings & Configuration

Use the configuration variables below in your to customize the behaviour of django-markupmirror:


Defines any of the default markup-types as default for fields where no markup_type or default_markup_type has been set explicitly.

Defaults to plaintext.


Whether to ignore the default markup types before they are registered


Dictionary of key to markup type.

Where markup type is either an subclass of BaseMarkup or a dot seperated import path to a subclass of BaseMarkup.

These will be merged on top of the default markup types.

Defaults to:

    'html': 'markupmirror.markup.HtmlMarkup',
    'plain': 'markupmirror.markup.PlainTextMarkup',
    'textile': 'markupmirror.markup.TextileMarkup',
    'markdown': 'markupmirror.markup.MarkdownMarkup',
    'restructuredText': 'markupmirror.markup.ReStructuredTextMarkup',

Defines the extensions to load for Markdown. Markdown’s package documentation contains a list of available extensions.

Defaults to ['extra', 'headerid(level=2)'].


Defines the output format for Markdown. One of HTML4, XHTML and HTML5.

Defaults to HTML5.


Dictionary of arguments passed directly to the Textile converter defined in textile.functions.textile.

The converter’s default function signature is: head_offset=0, html_type='xhtml', auto_link=False, encoding=None, output=None.

Defaults to:

    'encoding': 'utf-8',
    'output': 'utf-8'

Basic settings passed to all CodeMirror editor instances for initialization. Check the CodeMirror documentation on configuration settings for details.

Defaults to:

    'indentUnit': 4,
    'lineNumbers': True,
    'lineWrapping': True,
    'path': settings.STATIC_URL + 'markupmirror/',