Ron / BCLUG <admin@bclug.ca> wrote:
Keith Christian wrote on 2024-05-24 16:41:
pip install wheel mailman psycopg2-binary
Should, or must, any of Django, Hyperkitty, Postorius, Dart-Sass, or any other supporting programs be installed into this virtual environment ?
As I understand it, mailman-hyperkitty get installed into the venv, but django and postorius are pulled in as a dependency of mailman-web (I believe?)
Yes that is correct. I've actually a slightly different approach and when creating the env choose to bring in system packages as well:
python3 -m venv --system-site-packages --symlinks venv
The packages I install on a fresh system are: sudo apt install python3-dev python3-wheel python3-psycopg2 sassc python3-rcssmin python3-venv python3-certbot-nginx postgresql exim4-daemon-light Then in venv I just run pip install mailman mailman-hyperkitty mailman-web uwsgi
My goal here is that I want as minimum compilation tools on the system as possible. I installed the Ubuntu version of the psycopg2 package as it's the same version of the Postgresql software also maintained by Ubuntu. I seem to remember rcsmin needing compilation tools so installed the Ubuntu maintained package. I typically don't install Links on my systems but remember it was a requirement at some point so will probably include it on a new Ubuntu 24.04 host I am planning. The Certbott installation does itself pull in a few Python libraries that Mailman uses so when installing Mailman in the venv it doesn't have to pull as many packages. I did try and see what packages I could include from the system in this way but when we start adding more packages Apt starts to get crazy with dependencies, so I made the goal of just pulling in packages which required compilation.
Originally I used Gunicorn as the wsgi backend for the Django stuff from Nginx. This is because Gunicorn gets installed as a dependency when you pull in Mailman. When I did it this way I didn't need to install Python3-Dev, I only needed to install the Python3-Venv package. However my old setup using Gunicorn didn't use Mailman-Web, and when I migrated to using Mailman-Web as part of a Ubuntu 22.04 setup I had trouble getting Gunicorn to pick up the Django backend: https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/thread/G...
I discussed this here: https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/thread/G...
Apparently the installation doc is now updated with a Gunicorn example so when I go Ubuntu 24.04 I will try that method.
I have configured a system in this way in the past using Xapian and pulled in the Ubuntu Xapian packages. My new system uses Woosh as I migrated to Mailman-Web and that installed Woosh as a dependency, and I had forgotten to back up the Xapian indexes.
Andrew.