Skip to main content

LazySettings

A lazy proxy for either global Django settings or a custom settings object. The user can manually configure settings prior to using them. Otherwise, Django uses the settings module pointed to by DJANGO_SETTINGS_MODULE.

Attributes

AttributeTypeDescription
_wrapped`SettingsUserSettingsHolder`

Constructor

Signature

def LazySettings() - > null

Methods


configure()

@classmethod
def configure(
default_settings: object = global_settings,
**options: any
) - > null

Called to manually configure the settings. The 'default_settings' parameter sets where to retrieve any unspecified values from (its argument must support attribute access (getattr)).

Parameters

NameTypeDescription
default_settingsobject = global_settingsAn object used as a fallback for settings not explicitly provided in options.
**optionsanyArbitrary keyword arguments representing setting names and their corresponding values; names must be uppercase.

Returns

TypeDescription
nullnull

configured()

@classmethod
def configured() - > boolean

Return True if the settings have already been configured.

Returns

TypeDescription
booleanTrue if the internal settings object has been initialized, False otherwise.