Closed Deconstrained closed 2 years ago
I use something similar to this approach for indicating API Key and user (when necessary). The environment variable is the default but I allow for overrides at the command line on startup
parser.add_argument(
"--apikey",
default=os.environ.get("PD_API_KEY"),
help="API Key can be specified by env variable PD_API_KEY"
)
parser.add_argument(
"--user",
default=os.environ.get("PD_USER_ID"),
help="Overrides the user email in the env PD_USER_ID"
)
It's really bad practice to hard-code API keys. Our code examples should reflect that.
We could just do this to begin with: