Structure settings in modules#2499
Conversation
1445abb to
f77ac7d
Compare
|
One can confirm that the same settings are generated by comparing the output of |
|
You don't all have to review, but would be good to have more eyes on this :) |
richardebeling
left a comment
There was a problem hiding this comment.
Surprisingly unpainful to read, given the mental complexity that I felt our discussions about this required. Nice, I like it!
I'll have to play around with it a bit locally when the first round of discussions is through, particularly it's super hard on github to check whether stuff was forgotten when moving code around.
| OIDC_RP_CLIENT_ID = "evap" | ||
| OIDC_RP_CLIENT_SECRET = "evap-secret" # nosec |
There was a problem hiding this comment.
Next level: Can we make these required() iff ACTIVE_OPEN_ID_LOGIN is true? (If not, that's fine with me, just wondering, seems not too hard from my simple mind)
|
|
||
| ACTIVATE_OPEN_ID_LOGIN = required() | ||
|
|
||
| # replace 'example.com', OIDC_RP_CLIENT_ID and OIDC_RP_CLIENT_SECRET with real values in localsettings when activating |
There was a problem hiding this comment.
I feel like the ones you would need to change should be part of localsettings.py, I think they don't really make sense in here. Any argument I'm missing for keeping them here?
| git submodule update --init | ||
| ./manage.py compilemessages --locale de |
There was a problem hiding this comment.
| git submodule update --init | |
| ./manage.py compilemessages --locale de | |
| git submodule update --init | |
| export DJANGO_SETTINGS_MODULE=localsettings | |
| ./manage.py compilemessages --locale de |
Since we are shipping EvaP via PyPI, using the evap.localsettings module doesn't really cut it anymore. We want to ship the majority of settings as default, but overwrite some of them in the deployment. Furthermore, we may want to have default config values that depend on values overwritten later, and we may want to mix in settings that add to previously defined values. Clearly, we need to implement the nix module system for our settings.
On production (with the current naming, which I want to still change later) it would be used like this:
Alternatively, one can also make two Python files, one containing what I put in the
LocalSettingsclass namespace here, and the other just containingglobals().update(...)which then also includes the other file.