Reputation: 10317
Just wondering locally, I could access environment variables within google app engine? For example, I've stored an email and password and would like to access it like this:
import os
email = os.environ.get("EMAIL")
password = os.environ.get("PASSWORD")
Is there any way to do this?
Upvotes: 2
Views: 2849
Reputation: 1660
You can define variables in app.yaml to make them available to the os.environ dictionary:
env_variables:
EMAIL: '[email protected]'
Then access the variable with:
email = os.environ.get("EMAIL")
More info is in the documentation.
Upvotes: 2