skip to navigation
skip to content

Not Logged In

django-codemirror-widget 0.3.0

django-codemirror-widget is Django form widget library for using CodeMirror on textarea

Django form widget library for using CodeMirror on Textarea


sudo pip install django-codemirror-widget


sudo pip install git+git://

How to Use

  1. First, you need to specified CODEMIRROR_PATH on CODEMIRROR_PATH is the URI of CodeMirror directory like CODEMIRROR_PATH = r"javascript/codemirror". If you don't specify it, it defaults to 'codemirror'. CodeMirror should be put there.

  2. Use codemirror.widgets.CodeMirrorTextarea widgets for target Textarea like below:

    from django import forms
    from codemirror.widgets import CodeMirrorTextarea
    codemirror = CodeMirrorTextarea(mode="python", theme="cobalt", config={ 'fixedGutter': True })
    document = forms.TextField(widget=codemirror)


the URI of CodeMirror directory (your CodeMirror installation should live in {{ STATIC_URL }}/{{ CODEMIRROR_PATH }})
the default mode which may be a string or configuration map (DEFAULT: 'javascript')
the default theme applied (DEFAULT: 'default')
base mapping for the rest of the CodeMirror options (DEFAULT: { 'lineNumbers': True })
File Type Py Version Uploaded on Size
django-codemirror-widget-0.3.0.tar.gz (md5) Source 2013-02-04 3KB
  • Downloads (All Versions):
  • 45 downloads in the last day
  • 270 downloads in the last week
  • 713 downloads in the last month