Google_Application_credentials ist auch nach dem Einstellen von env_variables in app.yaml nullPython

Python-Programme
Anonymous
 Google_Application_credentials ist auch nach dem Einstellen von env_variables in app.yaml null

Post by Anonymous »

Ich stelle eine Flask -Anwendung für die Google App Engine (Standardumgebung, Python 3.9) bereit. />

Code: Select all

gcloud app describe --format=json | jq '.envVariables'
returns:

null
i
< /code>
ndicating, dass die Umgebungsvariable nicht korrekt eingestellt wurde.import os
from flask import jsonify

@app.route("/debug")
def debug():
file_exists = os.path.exists("./firebase_credentials.json")
return jsonify({
"GOOGLE_APPLICATION_CREDENTIALS": os.getenv("GOOGLE_APPLICATION_CREDENTIALS"),
"firebase_credentials_exists": file_exists
}), 200
< /code>
Gibt zurück: < /p>
{
"GOOGLE_APPLICATION_CREDENTIALS": null,
"firebase_credentials_exists": true
}
Dies bestätigt, dass die Service -Kontodatei in der App Engine -Instanz vorliegt, aber die Umgebungsvariable fehlt.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post