Skip to main content

Settings

This class manages application configuration by loading and validating settings from a specified module and merging them with global defaults. It ensures that specific configuration keys are correctly formatted as tuples or lists and provides a mechanism to track which settings have been explicitly overridden. Additionally, the class handles environment-level side effects such as configuring the system time zone based on the provided settings.

Attributes

AttributeTypeDescription
SETTINGS_MODULEstringThe Python path to the settings module used to initialize the class instance.
_explicit_settingssetA set of setting names that were explicitly defined in the provided settings module rather than inherited from global defaults.

Constructor

Signature

def Settings(
settings_module: string
)

Parameters

NameTypeDescription
settings_modulestringThe python path to the settings module to be loaded.

Signature

def Settings(
settings_module: string
)

Parameters

NameTypeDescription
settings_modulestringThe Python import path to the module containing application-specific configuration settings.

Methods


is_overridden()

@classmethod
def is_overridden(
setting: string
) - > boolean

Determines if a specific setting has been explicitly defined in the settings module rather than using a global default.

Parameters

NameTypeDescription
settingstringThe name of the configuration setting to check for an explicit override.

Returns

TypeDescription
booleanTrue if the setting was explicitly defined in the user-provided settings module, False otherwise.