Hum, I really really don't like the fix_settings function. But if you feel very strong about it, could you please at least call it "override_settings"?
For needs like this, what I would propose is using a more "traditional" approach with env vars. Something like:
Hum, I really really don't like the fix_settings function. But if you feel very strong about it, could you please at least call it "override_ settings" ?
For needs like this, what I would propose is using a more "traditional" approach with env vars. Something like:
* in magicicada/ settings/ __init_ _.py:
173 LOGGING = { 'MAGICICADA_ LOG_LEVEL' , 'INFO'),
...
204 'loggers': {
205 'django': {
206 'handlers': ['file'],
207 'level': os.getenv(
208 'propagate': True,
209 },
...
221 }
And then just export the env var to the value you desire, or execute the server with:
MAGICICADA_ LOG_LEVEL= DEBUG make start
Or alternatively, we could define a "debug" policy, a little big more "global", such as this:
LOG_LEVEL = 'INFO' if bool(os. getenv( 'MAGICICADA_ DEBUG', None)) else 'DEBUG'
173 LOGGING = {
...
204 'loggers': {
205 'django': {
206 'handlers': ['file'],
207 'level': LOG_LEVEL,
208 'propagate': True,
209 },
...
221 }
What do you think?