From e002371b5f710bf032cdefa0d40ec206c66c21ef Mon Sep 17 00:00:00 2001 From: "Alexander V. Nikolaev" Date: Sat, 9 Apr 2011 22:20:55 +0300 Subject: [PATCH] render_to_string missed in shortcuts in Django 1.3, import it correctly (I not test this patch with jinja2, but I believe it should work) --- djangosphinx/config.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/djangosphinx/config.py b/djangosphinx/config.py index 4b8f69f..5048a2c 100644 --- a/djangosphinx/config.py +++ b/djangosphinx/config.py @@ -17,16 +17,16 @@ if 'coffin' in settings.INSTALLED_APPS: import jinja2 - from coffin import shortcuts + from coffin.shortcuts import render_to_string as dj_render_to_string else: - from django import shortcuts + from django.template.loader import render_to_string as dj_render_to_string 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) + return dj_render_to_string(template, context, context_instance) def relative_path(*args): return os.path.abspath(os.path.join(settings.SPHINX_ROOT, *args))