Untitled
unknown
plain_text
7 months ago
312 B
1
Indexable
Never
from django.core.exceptions import ImproperlyConfigured def get_env_variable(var_name): try: return os.environ[var_name] except KeyError: error_msg = "Set the %s environment variable" % var_name raise ImproperlyConfigured(error_msg) SECRET_KEY = get_env_variable('SECRET_KEY')