Using the virtenv installation method seems to be reasonable, yes. Adding the suggested line i did not try yet.
Thanks!
Am 26. April 2024 10:29:18 MESZ schrieb Odhiambo Washington <odhiambo@gmail.com>:
On Fri, Apr 26, 2024 at 8:30 AM Thomas Stein <himbeere@meine-oma.de> wrote:
Am 2024-04-26 00:52, schrieb Mark Sapiro:
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.
After that I get:
File "/usr/share/mailman3-web/urls.py", line 20, in <module> from django.conf.urls import include, url ImportError: cannot import name 'url' from 'django.conf.urls' (/usr/lib/python3/dist-packages/django/conf/urls/__init__.py) dpkg: error processing package mailman3-web (--configure): installed mailman3-web package post-installation script subprocess returned error exit status 1 Errors were encountered while processing:
I guess I'll wait for the new package for now.
How about adding:
MIDDLEWARE += ('allauth.account.middleware.AccountMiddleware',)
in settings_local.py
And how about you use the virtualenv method <https://docs.mailman3.org/en/latest/install/virtualenv.html> for more peace of mind in the future?