Skip to content

Deprecate EXTENSIONS_ARGUMENTS #862

@winged

Description

@winged

The setting EXTENSIONS_ARGUMENTS was introduced like a year ago with the idea to have a place to inject custom settings that are used by extension code.

I think that the approach of passing almost-arbitrary stuff through a single settings variable is a poor architectural choice: it gets very cumbersome once more than one or two values are needed.

Instead of forcing everything into this one variable, why not add some documentation and showing how to define custom settings without going through the Django settings infra?

Just have a custom extension settings module (eg. document-merge-service/extensions/settings.py) that defines whatever needs to be defined by reading env vars just as the regular settings.py does. Just you'll have to import that one instead of the django.conf.settings.

This would also free you from encoding stuff into one env variable that could/should be multiple ones.

Example:

# document-merge-service/extensions/settings.py
import environ
env = environ.Env()

APPLICATION = env.str('EXT_APPLICATION')
SERVICE_GROUP_CONFIG = env.dict('EXT_SERVICE_GROUP_CONFIG')
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions