An extension of the Django Textarea widget made for editing Markdown with a live preview.
> pip install django-bootstrap-markdown
- Add
django-bootstrap-markdown
to the installed apps of your Django Project - Instead of using the django
Textarea
widget use theMarkdownInput
- Be sure to include the form's required media in the template. ie.
{{ form.media }}
- Also be sure to include Twitter Bootstrap
- Include the markdown urls:
urls.py
urlpatterns = patterns('',
...
url(r'^markdown/', include('django_bootstrap_markdown.urls')),
...
)
forms.py
from django import forms
from django_bootstrap_markdown.widgets import MarkdownInput
class PostForm(forms.Form):
title = forms.CharField()
markdown = forms.CharField( widget=MarkdownInput )