I need to implement some sort of captcha for Mailman accounts. As all my lists are for Norwegians, I think it's enough to have a simple question in Norwegian that has to be answered. I'm not a Python programmer, and I asked Gemini. He suggested that I should add a settings_local.py file in /etc/mailman3, which settings.py from the same folder should import, as it have, at the end:
try:
from .settings_local import *
except ImportError:
pass
But the code from settings_local.py doesn't semm to be run.
The settings_local.py have:
import sys
import os
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
if CURRENT_DIR not in sys.path:
sys.path.insert(0, CURRENT_DIR)
ACCOUNT_ADAPTER = 'mailman_local.adapter.CustomMailmanAccountAdapter'
ACCOUNT_FORMS = {'signup': 'mailman_local.forms_no.DynamicMathCaptchaSignupForm'}
INSTALLED_APPS += ('mailman_local',)
I have the directory /etc/mailman3/mailman_local with the following files:
- adapter.py
- forms_no.py
- __init__.py
If this at all is possible, I'd like to have the extra code/files in a place where an upgrade doesn't affect them, so /etc/mailman3 seems to be a good location.
Do you have suggestions in how to get this or a similar approach to work?
Thanks, Lars