On 4/25/24 14:01, Thomas Stein wrote:
Am 2024-04-25 22:03, schrieb Mark Sapiro:
I don't know how things are arranged in the Debian/Ubuntu package, but you may have a settings.py which at the end does something like
try: from settings_local import * except ImportError: pass
If that is the case, adding the above snippet to the end of settings_local.py should work.
Yes, that's the case. I added the snippet in question to settings_local.py but this leads to another error:
File "/usr/share/mailman3-web/settings.py", line 503, in <module> from settings_local import * File "/usr/share/mailman3-web/settings_local.py", line 194, in <module> x = list(MIDDLEWARE) ^^^^^^^^^^ NameError: name 'MIDDLEWARE' is not defined dpkg: error processing package mailman3-web (--configure):
Yes. I understand. In your case, MIDDLEWARE is only defined in settings.py and not in settings_local.py. As I understand it originally you added
x = list(MIDDLEWARE)
x.insert(0, 'allauth.account.middleware.AccountMiddleware')
MIDDLEWARE = x
to settings.py and you say it didn't help. I don't know why that wouldn't work as long as there is no setting for MIDDLEWARE in settings_local.py and you added that after the MIDDLEWARE setting in settings.py. When you say it didn't help, do you mean you still get the
django.core.exceptions.ImproperlyConfigured: allauth.account.middleware.AccountMiddleware must be added to settings.MIDDLEWARE
message or something else? I note that the original post in this thread
refers to /etc/mailman3/mailman-web.py which is presumably where the
package ultimately puts the Django settings, and I don't know what dpkg --configure
is doing.
One thing you could try is in settings_local.py, put
from settings import MIDDLEWARE
x = list(MIDDLEWARE)
x.insert(0, 'allauth.account.middleware.AccountMiddleware')
MIDDLEWARE = x
to work around the NameError.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan