-
Notifications
You must be signed in to change notification settings - Fork 66
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
Merging settings makes it almost impossible to fully override settings #2284
Labels
bug
Something's not working
Comments
I think the best approach is a combination of A and B, by moving the list of settings to be merged from the base installation to the actual settings file.. let me draft a PR |
3 tasks
I've re-assigned this to v1.5.1 |
mauromsl
added a commit
that referenced
this issue
Mar 12, 2024
mauromsl
added a commit
that referenced
this issue
Mar 12, 2024
Signed-off-by: Mauro MSL <[email protected]>
Closed by #2294 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
In load_janeway_settings the settings referred to by
DJANGO_SETTINGS_MODULE
are merged into the basecore.janeway_global_settings
.The method for merging involves appending to any existing sequence settings, and applying new keys to existing dictionaries. This means it's almost impossible to completely override sequence- or dict-based settings, and this behaviour is also potentially counter-intuitive.
For example, my attempt to insert a new middleware class into the existing Janeway default middleware list results in the default middleware being included twice:
Janeway version
This is on master, currently 7739efb.
Expected behavior
One of three things:
DJANGO_SETTINGS_MODULE
completely overrides the corresponding setting inglobal_janeway_settings
, but the current customconfigure_settings()
behaviour continues, orconfigure_settings()
approach is removed, andfrom core.global_janeway_settings import *
can be used inDJANGO_SETTINGS_MODULE
to the same effect, making things more explicit, with no backwards-compatibility, orload_janeway_settings
could detect whetherglobal_janeway_settings
is *-imported intoDJANGO_SETTINGS_MODULE
— as the new preferred approach — and disable the settings-merging behavour. This would provide backwards-compatibility for the current behaviour.The text was updated successfully, but these errors were encountered: