Package: django-stackedit
martorMartoris Markdown Editor plugin for Django and new face ofDracEditor.FeaturesLive PreviewIntegrated withAce EditorIntegrated withSemantic-UISupport Multiple Fields (fixed this issue)Upload Image to imgur.com(via API)andcustom 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 sheetsMartor Commands RefferenceSupport Django AdminToolbar ButtonsHighlightprePreviewRequirementsDjango>=2.0Markdown>=3.0requests>=2.12.4InstallationMartor is available directly fromPyPI:Installing the package.$ pip install martorDon’t forget to add'martor'to your'INSTALLED_APPS'setting(without migrations).# settings.py
INSTALLED_APPS = [
    ....
    'martor',
]Add url pattern to yoururls.py.# urls.py
# django >= 2.0
urlpatterns = [
    ...
    path('martor/', include('martor.urls')),
]

# django <= 1.9
urlpatterns = [
    ...
    url(r'^martor/', include('martor.urls')),
]Collect included some martor static files to yourSTATIC_ROOTfolder../manage.py collectstaticSetting Configurationssettings.pyPlease register application inhttps://api.imgur.com/oauth2/addclientto getIMGUR_CLIENT_IDandIMGUR_API_KEY.# Global martor settings
# Input: string boolean, `true/false`
MARTOR_ENABLE_CONFIGS = {
    '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)
MARTOR_ENABLE_LABEL = False

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

# Safe Mode
MARTOR_MARKDOWN_SAFE_MODE = True # default

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

# Markdown extensions (default)
MARTOR_MARKDOWN_EXTENSIONS = [
    'markdown.extensions.extra',
    'markdown.extensions.nl2br',
    'markdown.extensions.smarty',
    'markdown.extensions.fenced_code',

    # Custom markdown extensions.
    'martor.extensions.urlize',
    '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
MARTOR_MARKDOWN_EXTENSION_CONFIGS = {}

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

# Markdown Extensions
MARTOR_MARKDOWN_BASE_EMOJI_URL = 'https://assets-cdn.github.com/images/icons/emoji/' # default
MARTOR_MARKDOWN_BASE_MENTION_URL = 'https://python.web.id/author/' # default (change this)Check this setting is not set else csrf will not be sent over ajax calls:CSRF_COOKIE_HTTPONLY = FalseUsageModelfrom django.db import models
from martor.models import MartorField

class Post(models.Model):
    description = MartorField()Formfrom django import forms
from martor.fields import MartorFormField

class PostForm(forms.Form):
    description = MartorFormField()Adminfrom 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},
    }

admin.site.register(YourModel, YourModelAdmin)TemplateSimply safe the markdown content as html ouput with loading the templatetags frommartor/templatetags/martortags.py.{% load martortags %}
{{ field_name|safe_markdown }}

# example
{{ post.description|safe_markdown }}Custom UploaderIf you want to save the images uploaded to your storage,Martoralso provide to handle it. Please checkout thisWIKI.Test the Martor from this RepositoryI assume you already setup with virtual enviroment (virtualenv).$ git clone https://github.com/agusmakmun/django-markdown-editor.git
$ cd django-markdown-editor/ && python setup.py install
$ cd martor_demo/
$ python manage.py makemigrations && python manage.py migrate
$ python manage.py runserverAnd let checkout athttp://127.0.0.1:8000/simple-form/to your browser.Martor Commands RefferenceNotesMartorwas inspired by greatdjango-markdownx,Python MarkdownandOnline reStructuredText editor.