Skip to content

Configurations

drf-corekit is configured through the Django settings module.

DRF_COREKIT = {}

Logging

TRANSACTION_ID_HEADER

Name of the HTTP header used to store and propagate the transaction identifier.

Property Value
Key LOGGING.TRANSACTION_ID_HEADER
Type str
Required No
Default "X-Transaction-ID"

Example

DRF_COREKIT = {
    "LOGGING": {
        "TRANSACTION_ID_HEADER": "X-Correlation-ID",
    }
}

LOG_DIR_PATH

Base directory used by components that write log files, such as ScriptCommand.

Generated command logs are stored under:

<LOG_DIR_PATH>/scripts/<command_name>/
Property Value
Key LOGGING.LOG_DIR_PATH
Type str
Required No
Default "logs"

Example

DRF_COREKIT = {
    "LOGGING": {
        "LOG_DIR_PATH": BASE_DIR / "logs",
    }
}

Example Output

logs/
└── scripts/
    └── sync_users/
        └── 20260606_090000_a1b2c3d4.log

Warning

LOG_DIR_PATH must not be None when using ScriptCommand.

An ImproperlyConfigured exception will be raised if a command attempts to create execution logs without a configured log directory.