Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Added sample for Using Environment Variables. #1653

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 29, 2018

Conversation

michaelawyu
Copy link
Contributor

No description provided.

@michaelawyu michaelawyu requested a review from ace-n August 24, 2018 23:27
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Aug 24, 2018
@ace-n ace-n requested a review from andrewsg August 27, 2018 17:28
Copy link

@ace-n ace-n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - @andrewsg please review?


# [START functions_env_vars]
def env_vars(request):
return os.environ['FOO']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will throw an exception if FOO isn't set. If that's the desired outcome, that's fine; otherwise perhaps use os.getenv with a default value of something like "environment variable not set"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @andrewsg ! The documentation has one step specified before using this snippet, instructing developers to set up the FOO env var; though I agree it would be better to add a default value. Will add a new commit.

@michaelawyu michaelawyu merged commit 81f7f17 into master Aug 29, 2018
@michaelawyu michaelawyu deleted the michaelawyu-patch-functions-env-vars branch August 29, 2018 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.