def _render_to_response(template, request, *args, **kwargs): template_lib = _get_template_lib(template, kwargs) if template_lib == DJANGO: kwargs.update(csrf(request)) return django_render(request, template, *args, **kwargs) elif template_lib == MAKO: return django_mako.render_to_response(template, *args, **kwargs) else: raise Exception("Bad template lib: %s" % template_lib)
def _render_to_response(template, *args, **kwargs): template_lib = _get_template_lib(template, kwargs) if template_lib == DJANGO: return django_render_to_response(template, *args, **kwargs) elif template_lib == MAKO: return django_mako.render_to_response(template, *args, **kwargs) else: raise Exception("Bad template lib: %s" % template_lib)
def _render_to_response(template, context, *args, **kwargs): template_lib = _get_template_lib(template, kwargs) if template_lib == DJANGO: return django_render_to_response(template, context, *args, **kwargs) elif template_lib == MAKO: context['csrf_token_field'] = csrf_token(context) return django_mako.render_to_response(template, context, *args, **kwargs) else: raise Exception("Bad template lib: %s" % template_lib)