from .base import *
from decouple import config 
from django.core.exceptions import ImproperlyConfigured

ALLOWED_ENVIRONMENTS = ["development", "production", "staging"]

ENVIRONMENT = config("DJANGO_SETTINGS_FILE", default="development", cast=str)

if ENVIRONMENT == "development":
    from .development import *
elif ENVIRONMENT == "production":
    from .production import *
elif ENVIRONMENT == "staging":
    from .staging import *
else: 
    raise ImproperlyConfigured(f"No settings module found for environment '{ENVIRONMENT}', but it must be one of {ALLOWED_ENVIRONMENTS}.")