On 2/14/19 11:10 PM, Stephen J. Turnbull wrote:
Torge Riedel writes:
- there is a way to do this now via settings_local.py, but feels a little bit risky if default configuration changes on update of mailman
This should not be true. If it is, we need to fix that. Will check.
It is more or less true. The issue is that unlike mm_cfg.py and Defaults.py in Mailman 2.1, the recommended way to set up Django in Mailman 3 is to point Django at settings.py for the default config, and the last thing in settings.py is
try: from settings_local import * except ImportError: pass
Thus,the only way settings_local.py can change something like INSTALLED_APPS is to redefine INSTALLED_APPS in it's entirety which leads to the possibility of INSTALLED_APPS changing in settings.py and those changes not being picked up in settings_local.py.
The way around this is to remove the import of settings_local from settings.py and then put
from settings import *
at the beginning of settings_local.py and then point Django at settings_local rather than settings.
Then you can do things like
try: INSTALLED_APPS.remove('allauth.socialaccount.providers.google') except ValueError: pass
in settings_local.py except there are still issues because, e.g., INSTALLED_APPS is defined as a tuple (immutable) and not a list in settings.py.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan