def render_to(template=None, mimetype=None):
    def renderer(function):
        @wraps(function)
        def wrapper(request, *args, **kwargs):
            output = function(request, *args, **kwargs)
            if not isinstance(output, dict):
                return output
            tmpl = output.pop('TEMPLATE', template)
            try:
                return render_to_response(tmpl, output, \
                            context_instance=RequestContext(request), mimetype=mimetype)
            except TemplateDoesNotExist, e:
                logger.error("Default template route matched a template that is not found: %s" % tmpl)
                raise Http404("Template '%s' does not exist." % tmpl)
        return wrapper
    return renderer
Decorator for Django views that sends returned dict to render_to_response 
dataset/ETHPy150Open splunk/splunk-webframework/server/splunkdj/decorators/render.py/render_to