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
| Attribute | Type | Description |
|---|---|---|
| SETTINGS_MODULE | string | The Python path to the settings module used to initialize the class instance. |
| _explicit_settings | set | A 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
| Name | Type | Description |
|---|---|---|
| settings_module | string | The python path to the settings module to be loaded. |
Signature
def Settings(
settings_module: string
)
Parameters
| Name | Type | Description |
|---|---|---|
| settings_module | string | The 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
| Name | Type | Description |
|---|---|---|
| setting | string | The name of the configuration setting to check for an explicit override. |
Returns
| Type | Description |
|---|---|
boolean | True if the setting was explicitly defined in the user-provided settings module, False otherwise. |