Provides an application form, so users can submit group membership requests.
These membership requests can then be approved or declined by an admin user in the QWC configuration backend (if GROUP_REGISTRATION_ENABLED
is set to true
in the qwc-admin-gui
configuration).
Uses PostgreSQL connection service qwc_configdb
(ConfigDB).
Setup PostgreSQL connection service file pg_service.conf
:
[qwc_configdb]
host=localhost
port=5439
dbname=qwc_demo
user=qwc_admin
password=qwc_admin
sslmode=disable
Place this file in your home directory, or set the PGSERVICEFILE
environment variable to point to the file.
Set the ADMIN_RECIPIENTS
environment variable to a comma separated list of admin users who should be notified of new registration requests (default: None
).
Flask-Mail is used for sending mails like admin notifications. These are the available options:
MAIL_SERVER
: default ‘localhost’MAIL_PORT
: default 25MAIL_USE_TLS
: default FalseMAIL_USE_SSL
: default FalseMAIL_DEBUG
: default app.debugMAIL_USERNAME
: default NoneMAIL_PASSWORD
: default NoneMAIL_DEFAULT_SENDER
: default NoneMAIL_MAX_EMAILS
: default NoneMAIL_SUPPRESS_SEND
: default app.testingMAIL_ASCII_ATTACHMENTS
: default False
In addition the standard Flask TESTING
configuration option is used by Flask-Mail in unit tests.
Translation strings are stored in a JSON file for each locale in translations/<locale>.json
(e.g. en.json
). Add any new languages as new JSON files.
Set the DEFAULT_LOCALE
environment variable to choose the locale for the application form and notifications (default: en
).
Run standalone application:
python src/server.py
Registration form (if user is signed in):
http://localhost:5032/register
Install Python module for PostgreSQL:
apt-get install python3-psycopg2
Create a virtual environment:
python3 -m venv .venv
Activate virtual environment:
source .venv/bin/activate
Install requirements:
pip install -r requirements.txt
Start local service:
MAIL_SUPPRESS_SEND=True [email protected] [email protected] python src/server.py