here is my django code
I get this error when I test my delete function.
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin is therefore not allowed access. The response had HTTP status code 500.
def delete(self):
        ''' Deletes an existed file or folder. '''
        file    = self.request.GET.get('path').lstrip("/")
        path    = os.path.join(self.root,file)
        response = FileManagerResponse(path)
        response.set_response()
        if (self.is_safe_path(path)):
           if os.path.isdir(path):
               shutil.rmtree(path)
           elif os.path.isfile(path):
               os.remove(path)
           return JsonResponse(response.response)
        else:
           return self.fileManagerError(path=file)
here is my angular 4 code
   deleteFile(id) {
       let url = `http://127.0.0.1:8000/files/connectors/python/filemanager?time=1528047056540&mode=delete&path=${id}&_=1528045987217`;
      console.log(url);
      return this.http.get(url);
  }
 
     
    