This guide collects the repo’s maintenance scripts and the situations where they should be used. Use it together with the main README for day-to-day operational work.
Most scripts assume:
PATH.env exists in the repository rootUnless a script says otherwise, prefer running it from a Bash-compatible shell.
Set USE_UNFOLD=True in .env to run Django admin with the Unfold theme. Leave it unset or set it to False to use the classic Django admin.
Changing this value requires restarting or recreating the Django containers, because admin apps, widgets, templates, and static assets are selected when Django starts.
date-cleaninit / scripts/clean_init.shUse this when you want to reset local development data to a known starting point.
What it does:
media/archive and media/pdfs.env through Docker Composescripts/load_all_fixtures.shadmin, freshman, and member to adminUse this for:
Do not use this on environments that contain real data.
scripts/load_all_fixtures.shThis is the fixture loader used by clean_init.sh.
It loads:
fixtures/members.jsonfixtures/ads.jsonscripts/generate_dynamic_fixtures.pyTreat the generated fixture output as disposable development data.
docker-compose.dev-all.yml / date-all-* aliasesUse this when you need to run all associations simultaneously for style comparison or cross-association testing.
Each association gets its own web container on a dedicated port, sharing one PostgreSQL database and one Redis instance:
| Association | URL |
|---|---|
| biocum | http://localhost:8001 |
| date | http://localhost:8002 |
| kk | http://localhost:8003 |
| pulterit | http://localhost:8004 |
The database is exposed on host port 5433 to avoid conflicting with the regular dev stack on 5432.
source env.sh or adding them to your shell config)The helpers use the nearest date-website checkout from your current directory, falling back to DATE_WEBSITE_DIR when you are outside a checkout.
date-all-start # build and start all containers
date-all-stop # tear everything down
date-all-cleaninit # reset to fixture data against the dev-all stack
An init container runs once on startup — it waits for PostgreSQL, then runs migrate, collectstatic, and compilemessages using PROJECT_NAME=date. All web containers wait for init to complete before accepting requests.
The web service (port 8002) is named web specifically so clean_init.sh can target it when running date-all-cleaninit.
init at startup. If you change CSS or JS, restart with date-all-start to pick up the changes.date-all-cleaninit alias passes COMPOSE_FILE_PATH=docker-compose.dev-all.yml directly to clean_init.sh so it targets the dev-all stack.scripts/backup_postgres.shUse this for routine PostgreSQL backups.
Typical usage:
./scripts/backup_postgres.sh [dev|prod|path/to/env] [output_dir]
Behavior:
scripts/lib/date_env.sh./scripts/backup_postgres.sh [output_dir] form for local ad-hoc backupsdb service if neededUse this before risky schema or infrastructure work, and especially before any major PostgreSQL version upgrade.
For Kubernetes deployments, the Helm chart provides a PostgreSQL backup CronJob that can upload compressed dumps to Backblaze B2. See Kubernetes and k3s Deployment Notes for the k3s backup workflow.
update-postgres.shUse this only for major PostgreSQL version upgrades.
It:
scripts/backup_postgres.shDATE_POSTGRESQL_VERSIONtemplate1, which also works when DB_DATABASE=postgresThe Compose db service also wraps the upstream Postgres entrypoint so existing volumes that were initialized with the legacy /var/lib/postgresql/data layout are moved into the configured PGDATA subdirectory on first boot.
This script is destructive if used incorrectly. Read the warnings in the README before running it.
scripts/validate_translations.pyUse this to validate locale completeness before merging translation-heavy work.
python scripts/validate_translations.py
It checks each required locale catalog for:
django.po filesThis is useful after makemessages, after large translation edits, and before release branches.
These scripts are more task-specific and should usually be run only by someone familiar with the target app and data shape:
scripts/import_alumni.pyscripts/export_subscription_status.pyscripts/export_ctf_guesses.pyscripts/merge_events.pyscripts/bulk_send_confirmation.pyscripts/resend_signup_emails.pyscripts/mass_upload.pyscripts/s3_upload.pyscripts/s3_populate_db.pyscripts/create_album.pyBefore using one of these on shared or production-like data: