Base SettingsΒΆ

Base settings used to initialise settings object.

DEBUG

Type: bool

Default: False

Enable debug mode

LOG_LOGGERS

Default: {}

Simple method for configuring loggers that is merged into the default logging configuration. This allows for custom loggers to be configured without needing to duplicate the entire logging configuration.

Example:

LOG_LOGGERS = {
    "my_package.my_module": {
        "level": "INFO",
        "handlers": ["console"]
    }
}
LOG_HANDLERS

Default: {}

Simple method for configuring log handlers that is merged into the default logging configuration. This allows for custom handlers to be configured without needing to duplicate the entire logging configuration.

By default all handlers defined in this dict are added to the root handler, if this is not desired set the non_root argument to True.

See the Logging Handlers in the Python documentation for a complete list of builtin handlers.

Example:

LOG_HANDLERS = {
    "file": {
        "class": "logging.handlers.RotatingFileHandler",
        "stream": "/path/to/my/file.log",
        "maxBytes": 5_242_880,  # 5MiB
    },
    "special_file": {
        "class": "logging.FileHandler",
        "non_root": True,  # Don't assign to root logger
        "stream": "/path/to/my/special.log",
    }
}
LOGGING

Type: Dict

Default: {}

Logging configuration.

The following configuration is applied by default:

LOGGING = {
    "formatters": {
        "default": {
            "format": "%(asctime)s | %(levelname)s | %(name)s | %(message)s",
        },
    },
    "handlers": {
        "console": {
            "class": "logging.StreamHandler",
            "formatter": "default",
            "stream": "ext://sys.stderr",
        },
    },
    "root": {
        # "level" : "INFO",  # Set from command line arg parser.
        "handlers": ["console"],
    }
}
CHECK_LOCATIONS

Type: List

Default: []

Locations to import to ensure checks are registered.

FEATURE_FLAGS

Type: Dict

Default: {}

Feature flags definition, this is a simple configuration of:

FEATURE_FLAGS = {
    "flag-name": True,  # State of True, False
}
FEATURE_FLAG_PREFIX

Type: str

Default: PYAPP_FLAG_

Prefix applied to flag names for environment variables