Is there a way to avoid using the client_secret.json file and use variables from it by declaring them programmatically in the project setup files?
I mean instead of using
KEY_FILE_LOCATION = '/home/user/ga/client_secrets.json'
credentials = ServiceAccountCredentials.from_json_keyfile_name(
KEY_FILE_LOCATION, SCOPES)
smth like this
settings.py
CLIENT_CONFIG = {
....
'client_id': settings.GOOGLE_CLIENT_ID,
'project_id': settings.GOOGLE_PROJECT_ID,
'private_key': settings.GOOGLE_CLIENT_SECRET,
.....
}
main.py
from settings import CLIENT_CONFIG
credentials = ServiceAccountCredentials.SOME_FUNCTION(
CLIENT_CONFIG, SCOPES)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…