Skip to content

Instantly share code, notes, and snippets.

@codeadict
Created January 7, 2018 21:39
Show Gist options
  • Select an option

  • Save codeadict/ea9fe4c86628585e0b04c39ce76a2874 to your computer and use it in GitHub Desktop.

Select an option

Save codeadict/ea9fe4c86628585e0b04c39ce76a2874 to your computer and use it in GitHub Desktop.
Loading .env
$ cat .env
API_KEY=supersecretstuff
$ pipenv run python
Loading .env environment variables…
Python 3.6.3 (default, Oct 4 2017, 06:09:15)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.getenv['API_KEY']
'supersecretstuff'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment