Markdown Editor for Django

Hi All,

I’ve been using Martor (https://github.com/agusmakmun/django-markdown-editor) as a markdown editor in my Django blog project. It’s not too bad, but I suspect there might be better ways to write markdown in a Django powered blog.

So my question is what do you use in your own projects for writing markdown in a Django application? Or perhaps you have a different way of writing and inputting markdown into your Django application?

Cheers,

C

1 Like

It really depends on your needs – I usually use the Python markdown with bleach for sanitising the input to a list of restricted allowed tags. I combine those two into a template tag – shout-out to the pretix project, where I saw the practice first. You can see it here.

Cheers Rixx. Bleach looks very interesting and is something that I’ll check out.

What I’m really on the lookout for at this stage though is a nice editor for me to write my posts and articles in. Lot’s of sites have them, for example, Confluence and Jira, Stackoverflow, this site, but I can’t seem to find a highly recommend one that plugs into Django. I’m quite surprised by this, as I thought such a tool would be very popular. Of course, I could be missing something obvious.

Which workflow do you have for actually inputting the markdown into Django? Are you using the standard editor/textfield that comes with Django?

Cheers,

C

I combine the rendering done by bleach and markdown on finished texts with a simple side-by-side markdown editor. I built that one using JavaScript alone, so I had no need of any Django integration (and I’m not quite sure what such an integration would gain). I’m using marked.js because it is small and standalone, but there are really a lot of options out there. You just tie an event listener to the input field, and render its contents to the output element.

Cheers! I’ll give something like that a go. Thanks for the tips.

Cheers,

C