diff --git a/djangosphinx/config.py b/djangosphinx/config.py index 4b8f69f..079bb83 100644 --- a/djangosphinx/config.py +++ b/djangosphinx/config.py @@ -13,20 +13,11 @@ assert getattr(settings, 'SPHINX_ROOT', None) is not None, "You must specify `SPHINX_ROOT` in your settings." -from django.template import RequestContext - if 'coffin' in settings.INSTALLED_APPS: import jinja2 - from coffin import shortcuts + from coffin.shortcuts import render_to_string else: - from django import shortcuts - -def render_to_string(template, context, request=None): - if request: - context_instance = RequestContext(request) - else: - context_instance = None - return shortcuts.render_to_string(template, context, context_instance) + from django.template.loader import render_to_string def relative_path(*args): return os.path.abspath(os.path.join(settings.SPHINX_ROOT, *args)) @@ -36,6 +27,7 @@ def relative_path(*args): 'SPHINX_PORT': getattr(settings, 'SPHINX_PORT', '3312'), 'relative_path': relative_path, } + if getattr(settings, 'DATABASES', None): context.update({ 'DATABASE_HOST': settings.DATABASES['default']['HOST'],