def api_get(self, request, chart_name, prefix=None):
        chart = self.get_chart(request, chart_name, prefix)

        if chart:
            html = mark_safe(u'%s' % chart)
            attrs = chart.attrs
        else:
            html = mark_safe(self.security_failure_message)
            attrs = {}
        
        return_data = {
            'html': html,
            'attrs': attrs,
        }
        
        return HttpResponse(json.dumps(return_data), mimetype='application/javascript')
dataset/ETHPy150Open evanbrumley/django-report-tools/report_tools/views.py/ReportView.api_get/original