def METHOD_NAME(request):
  connector = json.loads(request.POST.get('connector', '{}'))
  try:
    Connector.objects.get(id=connector['id']).delete()
    # TODO: if `sqlalchemy` interface, delete key in ENGINES
  except Exception as e:
    raise PopupException(_('Error deleting connector %s: %s') % (connector['name'], e))
  update_app_permissions()
  return JsonResponse({})