Skip to main content

django-simplemde is a WYSIWYG markdown editor for Django

Project description

A markdown editor(with preview) for Django

Use markdown editor https://github.com/sparksuite/simplemde-markdown-editor in django project, this project is inspired by https://github.com/douglasmiranda/django-wysiwyg-redactor/

Getting started

  • install django-simplemde
pip install django-simplemde
  • add 'simplemde' to INSTALLED_APPS.
INSTALLED_APPS = (
    # ...
    'simplemde',
    # ...
)

Using in models

from django.db import models
from simplemde.fields import SimpleMDEField

class Entry(models.Model):
    title = models.CharField(max_length=250, verbose_name=u'Title')
    content = SimpleMDEField(verbose_name=u'mardown content')

SimpleMDE options

You could set SimpleMDE options in settings.py like this:

SIMPLEMDE_OPTIONS = {
    'placeholder': 'haha',
    'status': False,
    'autosave': {
        'enabled': True
    }
}

Right now this plugin supports SimpleMDE Configurations, but only the static ones(don't support js configurations like previewRender)

for autosave option, you dont need to set it, this plugin will generate uniqueId with python's uuid.uuid4 automatically

Get SimpleMDE instance from DOM

After SimpleMDE initialized, you could get SimpleMDE instance from dom element like this:

$('.simplemde-box')[0].SimpleMDE

Project details


Download files

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

Source Distribution

django-simplemde-0.1.4.tar.gz (96.4 kB view details)

Uploaded Source

File details

Details for the file django-simplemde-0.1.4.tar.gz.

File metadata

  • Download URL: django-simplemde-0.1.4.tar.gz
  • Upload date:
  • Size: 96.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.5

File hashes

Hashes for django-simplemde-0.1.4.tar.gz
Algorithm Hash digest
SHA256 5da5f837a42a4102eef46e2f9af8c7d93869a2540542944fad37650865fe45d7
MD5 f08f17a9cc592a0f7c28012721193c82
BLAKE2b-256 4c478542fdb6f3d599778bbaadc8d3898f700d1d43355a86d917d035d1ead03c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page