This is the SPI membership web application, which lives at:
It enables the following actions:
- New member registration
Non-contributing members just need to apply for a new account and verify their email address.
- Contributing member application
Once a user is a valid non-contributing member they can submit an application for contributing membership, providing details of why they meet the criteria.
- Management of member applications
Users who are marked as application managers can review outstanding applications for contributing membership and approve or deny them as appropriate.
- Centralized authentication system
The members applications acts as a centralized authentication system for SPI's mailing list system based on PGLister and its private archives based on PGArchives.
The app is written in Python using the Django frame work and designed to run on a Debian 12 (Bookworm) host.
The official code repository for the site lives within the SPI infrastructure and can be browsed at:
https://gitlab.com/spi-inc/members-django
There is also an unofficial mirrors in GitHub:
https://github.com/SPI/members-django
Patches can be emailed to [email protected] or submitted via the pull request feature on these sites.
- python3
- python3-django
- postgresql
- python3-psycopg2
- pyenv
- python-virtualenv
- python-wxgtk3.0 # for OpenSTV
pip packages: see requirements.txt
This is a role to deploy members in SPI's (currently private) ansible repository.
To redeploy, use:
ansible-playbook --vault-password-file .vault_pass.txt playbooks/leslie_jess.yml --tags members-django
Install venv:
CC=clang pyenv install 3.11.2
virtualenv -p ~/.pyenv/versions/3.11.2/bin/python3 venv
source ./venv/bin/activate
pip install django==4.2
python -m django --version # Should be 4.2
pip install psycopg2-binary requests pycryptodomex
Create database:
sudo -u postgres psql -c 'create role <username>' ; sudo -u postgres psql -c 'create database membersdjango'
python manage.py migrate
You can also use the ansible script to deploy the application in a testing or production environment.
To run tests, the current user must have the rights to create a database. In postgres, run:
alter user <USERNAME> CREATEDB;
In the right venv, they can then be run using:
PYTHONPATH=membersapp/app/OpenSTV/openstv python manage.py test
To authenticate users in PGLister and PGArchives-private, a community auth site must be created in Membersdjango. First, create a community org auth in /admin/account/communityauthorg/. Then, create the auth site in /admin/account/communityauthsite/.
Use the following parameters:
- Redirecturl: https://lists.spi-inc.org/auth_receive/
- Apiurl: https://lists.spi-inc.org/auth_api/
- Cryptkey: a random password that you can create using
python tools/communityauth/generate_cryptkey.py
- Org: the org site you just created
Then add the correct information in membersdjango's settings.py
(or local_settings.py
):
USE_PG_COMMUNITY_AUTH = True
PGAUTH_REDIRECT = "https://members.spi-inc.org/account/auth/1/""
PGAUTH_KEY = "YOUR_CRYPTKEY"
LOGIN_URL = "/accounts/login/"
There are several scripts to handle the links between these different components.
email-stats
: send email containing stats on members and applicationsemail-voters
: email contributing members about open votescleanup-contrib
: deal with sending notifications to or cleaning up inactive SPI contributing memberssubprivate
: prompt the members application for contributing members list and subscribe them to the spi-private mailing list
Add these as cron jobs such as:
email-stats
,email-voters
andcleanup-contrib
(ping
andclean
) are running in the context of the membersdjango applicationsubprivate
is running in the context of PGLister