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')
...
The setting
EXTENSIONS_ARGUMENTSwas 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 thedjango.conf.settings.This would also free you from encoding stuff into one env variable that could/should be multiple ones.
Example: