def delete_image(request): src = request.POST.get('src') try: Image.delete(src) return Response(json.dumps('ok')) except: raise Exception('Could not delete image')
def delete_image(request): src = request.POST.get('src', '') try: Image.delete(src) return HttpResponse('ok', content_type="application/json") except: raise Exception('Could not delete image')
def delete_image(): src = request.form.get('src') try: Image.delete(src) return json.dumps('ok') except: raise Exception('Could not delete image')