Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Django - Load Environment variables for safe handling of password/key
def load_env(env_name):
import os
if not os.environ.get(env_name):
print(env_name + " is not defined")
raise SystemExit
env_name = os.environ[env_name]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment