fairdm.conf#

FairDM configuration package: settings baseline, environment layers and addons.

Provides a production-ready Django configuration baseline, layered with environment overrides selected by the DJANGO_ENV variable, and addon integration.

Also holds record, the provenance of the layers setup() composes. setup() snapshots the caller’s scope before and after each layer’s include() call and records the delta: the uppercase setting names that layer wrote. Never a value, because the scope holds SECRET_KEY and the database and email passwords. The record lives here rather than in settings so it never appears in a settings dump. show_config reads it after django.setup().

Subpackages#

Submodules#

Package Contents#

Classes#

Layer

One layer setup() considered, in application order.

Provenance

The ordered record of layers the most recent setup() call composed.

Data#

API#

class Layer[source]#

One layer setup() considered, in application order.

Attributes: name: The layer’s name, such as production or an addon’s name. path: The file the layer was loaded from, or None when it has none. found: Whether the layer’s file existed. settings: The uppercase setting names the layer wrote.

name: str#

None

path: str | None#

None

found: bool#

None

settings: tuple[str, ...]#

‘field(…)’

class Provenance[source]#

The ordered record of layers the most recent setup() call composed.

Initialization

reset() → None[source]#

Clear the record so a second setup() call replaces it rather than appends.

add_layer(name: str, path: str | None, found: bool, settings) → None[source]#

Append one layer’s outcome, in the order setup() applied it.

Args: name: The layer’s name. path: The file the layer was loaded from, or None. found: Whether the layer’s file existed. settings: The setting names the layer wrote.

layers() → list[fairdm.conf.Layer][source]#

Return every layer considered, in application order.

Returns: A copy of the recorded layers.

producer(setting: str) → fairdm.conf.Layer | None[source]#

Return the layer that produced setting’s final resolved value, if any.

Later layers override earlier ones, so the producer is the last layer whose settings include this name. A layer is credited when it changed the value, not merely when it assigned one.

Args: setting: The setting name to look up.

Returns: The producing layer, or None when no layer wrote the setting.

replace(layers) → None[source]#

Restore a previously captured layer list, discarding the current one.

Args: layers: The layers to restore, in application order.

record#

‘Provenance(…)’