def send_material_usage(request, course): stats = Stats(course) encoded = json.dumps(stats.material_usage()) response = HttpResponse(encoded, content_type="application/json") response['Access-Control-Allow-Origin'] = '*' return response
def send_material_usage(request, course): stats = Stats(course) encoded = json.dumps(stats.material_usage()) return HttpResponse(encoded, content_type = "application/json")