APPID_LIVE = 'awesomeapp'
APPID_DEV = 'awesomeapp-dev'
APPID_PILOT = 'awesomeapp-pilot'
client_secrets_map = {APPID_LIVE: 'client_secrets_live.json', APPID_DEV:
    'client_secrets_dev.json', APPID_PILOT: 'client_secrets_pilot.json'}
client_secrets_filename = client_secrets_map.get(app_identity.
    get_application_id(), APPID_DEV)
flow = flow_from_clientsecrets(filename=client_secrets_filename, scope=
    scope, redirect_uri=redirect_uri)
f = open(client_secrets_filename, 'r')
client_secrets = json.loads(f.read())
f.close()
Securely storing environment variables in GAE with app.yaml