class get_subtype(viewsets.ViewSet😞
def list(self, request,projectname😞
# Define your username and password
username = ""
password = ""
# Build the URL for the feature service
try:
# Connect to the GIS using your username and password
gis = GIS(url=feature_service_url, username=username, password=password)
# Get information about the feature service
feature_service = gis.content.get(feature_service_url)
print("feature_service",feature_service)
feature_service_info = feature_service.layers[0].properties # Assuming you want information about the first layer
print(feature_service_info)
return Response(feature_service_info)
except Exception as e:
# Handle any errors here
print(f"Error: {e}")
return Response({"error": f"Error: {e}"}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
It throwing following error {"error":"Error: Access not allowed request\n(Error Code: 403)"}