django-markupmirror Documentation

django-markupmirror is a custom field and widget for editing markup text in Django. It utilizes the CodeMirror JS editor for a richer editing experience.

It uses parts of James Turk’s django-markupfield and adds a nicer widget with live-preview and an extension content-type for FeinCMS.

on Read the Docs:
Code and issues
on bitbucket:
on PyPi:


django-markupmirror is currently tested with Django 1.4 on Python 2.6 and 2.7 only, but with almost complete test coverage.


  • To install django-markupmirror, use pip and add 'markupmirror' to the INSTALLED_APPS in your Django project.

  • 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)),
  • Add one or more markupmirror.fields.MarkupMirrorField s to your models and define markup_type or default_markup_type:

    class ModelWithMarkup(models.Model):
        content = MarkupMirrorField(
            verbose_name="content", markup_type='markdown')
  • If you want the FeinCMS content-type model MarkupMirrorContent, you’ll also need to add 'markupmirror.feincms' to your INSTALLED_APPS.

    Also, you need to register the content-type model with FeinCMS’ Page module:

    from import Page
    from markupmirror.feincms.models import MarkupMirrorContent

By default, django-markupmirror comes with markup converters for plain text (converts links and linebreaks) and HTML (does nothing). Converters for Markdown, reStructuredText and Textile are also available, but require 3rd-party libraries to be installed. However, you can register your own markup converters.