Skip to main content

Django Markdown Editor

Project description

martor pypi version,%201.9,%201.10,%201.11,%202.0-green.svg?style=flat-square

Martor is Markdown Editor plugin for Django and new face of DracEditor.


  • Live Preview
  • Integrated with Ace Editor
  • Integrated with Semantic-UI
  • Support Multiple Fields (fixed this issue)
  • Upload Image to (via API) and custom uploader.
  • Direct Mention users @[username] - (require user to logged in)
  • Support embed/iframe video from (Youtube, Vimeo, Dailymotion, Yahoo, Veoh, & Metacafe)
  • Emoji :emoji_name: + Cheat sheets
  • Martor Commands Refference
  • Support Django Admin
  • Toolbar Buttons
  • Highlight pre



  • Django>=1.10.1
  • Markdown>=2.6.7
  • requests>=2.12.4


Martor is available directly from PyPI:

  1. Installing the package.
$ pip install martor
  1. Don’t forget to add 'martor' to your 'INSTALLED_APPS' setting (without migrations).
  1. Add url pattern to your
# django >= 2.0
urlpatterns = [
    path('martor/', include('martor.urls')),

# django <= 1.9
urlpatterns = [
    url(r'^martor/', include('martor.urls')),
  1. Collect included some martor static files to your STATIC_ROOT folder.
./ collectstatic

Setting Configurations

Please register application in to get IMGUR_CLIENT_ID and IMGUR_API_KEY.

# Global martor settings
# Input: string boolean, `true/false`
    'imgur': 'true',     # to enable/disable imgur/custom uploader.
    'mention': 'false',  # to enable/disable mention
    'jquery': 'true',    # to include/revoke jquery (require for admin default django)
    'living': 'false',   # to enable/disable live updates in preview

# To setup the martor editor with label or not (default is False)

# Imgur API Keys
MARTOR_IMGUR_CLIENT_ID = 'your-client-id'
MARTOR_IMGUR_API_KEY   = 'your-api-key'

# Safe Mode

# Markdownify
MARTOR_MARKDOWNIFY_FUNCTION = 'martor.utils.markdownify' # default
MARTOR_MARKDOWNIFY_URL = '/martor/markdownify/' # default

# Markdown extensions (default)

    # Custom markdown extensions.
    'martor.extensions.del_ins',    # ~~strikethrough~~ and ++underscores++
    'martor.extensions.mention',    # to parse markdown mention
    'martor.extensions.emoji',      # to parse markdown emoji
    'martor.extensions.mdx_video',  # to parse embed/iframe video

# Markdown Extensions Configs

# Markdown urls
MARTOR_UPLOAD_URL = '/martor/uploader/' # default
MARTOR_SEARCH_USERS_URL = '/martor/search-user/' # default

# Markdown Extensions
MARTOR_MARKDOWN_BASE_MENTION_URL = '' # default (change this)

Check this setting is not set else csrf will not be sent over ajax calls:




from django.db import models
from martor.models import MartorField

class Post(models.Model):
    description = MartorField()


from django import forms
from martor.fields import MartorFormField

class PostForm(forms.Form):
    description = MartorFormField()


from django.db import models
from django.contrib import admin

from martor.widgets import AdminMartorWidget

from yourapp.models import YourModel

class YourModelAdmin(admin.ModelAdmin):
    formfield_overrides = {
        models.TextField: {'widget': AdminMartorWidget},
    }, YourModelAdmin)


Simply safe the markdown content as html ouput with loading the templatetags from martor/templatetags/

{% load martortags %}
{{ field_name|safe_markdown }}

# example
{{ post.description|safe_markdown }}

Custom Uploader

If you want to save the images uploaded to your storage, Martor also provide to handle it. Please checkout this WIKI.

Test the Martor from this Repository

I assume you already setup with virtual enviroment (virtualenv).

$ git clone
$ cd django-markdown-editor/ && python install
$ cd martor_demo/
$ python makemigrations && python migrate
$ python runserver

And let checkout at to your browser.

Martor Commands Refference


Martor was inspired by great django-markdownx, Python Markdown and Online reStructuredText editor.

Project details

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
martor-1.3.0.tar.gz (950.1 kB) Copy SHA256 hash SHA256 Source None Aug 20, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page