code: def check_api_key(request, key, hproPk):
      
  
      if settings.PIAPI_STANDALONE:
          return True
  
      (_, _, hproject) = getPlugItObject(hproPk)
  
      if not hproject:
          return False
  
      if hproject.plugItApiKey is None or hproject.plugItApiKey == '':
          return False
  
      return hproject.plugItApiKey == key
docs: Check if an API key is valid