Files
old-saburly-wagtail-web/saburly/settings/getenv.py

9 lines
244 B
Python
Raw Normal View History

2024-08-28 13:41:19 +02:00
import os
from django.core.exceptions import ImproperlyConfigured
def get_env_variable(var_name):
try:
return os.environ[var_name]
except KeyError:
raise ImproperlyConfigured(f"Set the {var_name} environment variable")