Works. My fault, see below:
On Monday, 12 October 2026 15:32:12 CEST Mark Sapiro wrote:
On 10/12/26 5:12 AM, Andreas Vetter wrote:
First try, first problem:
(venv) mailman@lists:~> django-admin shell Python 3.11.15 (main, Aug 14 2026, 20:29:30) [GCC] on linux Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole)
from hyperkitty.models import MailingList
Traceback (most recent call last): ...
django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
I don't see INSTALLED_APPS in any of the configuration files. Where should this be defined?
It is defined in mailman_web.settings.base which is imported by /etc/mailman3/settings.py. The issue is your django-admin command is not accessing the /etc/mailman3/settings.py file.
Did you ever try the interaction in <https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message /ZA4EHLWBZITGZB275S435EBF4HRCC4EP/>? If so, what is the difference between the django-admin you ran there and this one?
When I use mailman-web shell it works.
In any case try
PYTHONPATH=/etc/mailman3 DJANGO_SETTINGS_MODULE=settings django-admin shell
With this it works, too.
Both scripts work for me in "mailman-web shell".
I am sorry for the noise. The correct usage of django-admin is of course well documented here: https://docs.mailman3.org/en/latest/django-primer.html
Thank you for all the help, Andreas