Installation and usage


Django Markdownify requires Django (obviously), as well as Markdown and Bleach version 2 or higher. When installing Django Markdownify, dependencies will be installed automatically.


Install Django Markdownify with pip:

pip install django-markdownify

Or add django-markdownify to your requirements.txt and run pip install -r requirements.txt

Finally add markdownify to your installed apps in



Load the tag in your template:

{% load markdownify %}

Then you can change markdown to html as follows:

{{ 'text'|markdownify }}

Use Markdown in your template directly:

{% load markdownify %}
{{'Some *test* [link](#)'|markdownify }}

Or use the filter on a variable passed to the template via your views. For example:
class MarkDown(TemplateView):
    template_name = 'index.html'

    def get_context_data(self, **kwargs):
        markdowntext = open(os.path.join(os.path.dirname(__file__), 'templates/')).read()

        context = super(MarkDown, self).get_context_data(**kwargs)
        context['markdowntext'] = markdowntext

        return context

{% load markdownify %}
{{ markdowntext|markdownify }}