klen/django_markdown — pull request #33 by aykut (2014-09-25 08:35:43+00:00)
Title: INIT_TEMPLATE Initialization Fix

Hi,

I want to use django_markdown by depending on a settings variable like MARKDOWN_ENABLED boolean, so in admin.py I import its widget like that:
```
try:
from django_markdown.widgets import MarkdownWidget
except ImportError:
pass
```

However, because of admin.auto_discover, it initializes this lines ``INIT_TEMPLATE = loader.get_template(settings.MARKDOWN_EDITOR_INIT_TEMPLATE)`` under utils.py. If django_markdown isn't included in INSTALLED_APPS, this crashes the whole app, because it can't find django_markdown/editor_init.html.

So why not move it into ``editor_js_initialization``, since it is not imported anywhere else.