Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate EXTENSIONS_ARGUMENTS #862

Open
winged opened this issue Oct 7, 2024 · 0 comments
Open

Deprecate EXTENSIONS_ARGUMENTS #862

winged opened this issue Oct 7, 2024 · 0 comments

Comments

@winged
Copy link
Member

winged commented Oct 7, 2024

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')
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant