def delete_file(request): src = request.POST.get('src', '') try: File.delete(src) return HttpResponse('ok', content_type="application/json") except: raise Exception('Could not delete file')
def delete_file(): src = request.form.get('src') try: File.delete(src) return json.dumps('ok') except: raise Exception('Could not delete file')
def delete_file(request): src = request.POST.get('src') try: File.delete(src) return Response(json.dumps('ok')) except: raise Exception('Could not delete file')
def delete(src): """ Delete video from disk. Parameters: src: string """ return File.delete(src)