The project has little room for configuration as most of it is hardcoded.
It'd be nice to have a settings file where the user can set their configurations, or set them as environment variables with the CLOUDISK_ prefix, then get them with a function.
Example:
# settings.py
EMAIL_FROM = "..."
# .env
CLOUDISK_EMAIL_FROM = "..."
The getter function:
def get_config(key: str, default: Any):
if isinstance(key, str):
raise Error("key must be a string")
if key.upper() != key:
raise Error("key must have all uppercase")
if env := os.environ.get(f"CLOUDISK_{key}"):
return env
settings = __import__(config_module):
var = getattr(settings, key, default)
return var
The project has little room for configuration as most of it is hardcoded.
It'd be nice to have a settings file where the user can set their configurations, or set them as environment variables with the
CLOUDISK_prefix, then get them with a function.Example:
The getter function: