def load_images(request): try: response = Image.list('/public/') except Exception: response = {'error': str(sys.exc_info()[1])} return HttpResponse(json.dumps(response), content_type="application/json")
def load_images(request): try: response = Image.list('/public/') except Exception: response = {'error': str(sys.exc_info()[1])} return Response(json.dumps(response))