Management Commands
TruePPM ships a small set of Django management commands. Run them with
python manage.py <command> inside the API container, for example:
docker compose exec api python manage.py seed_demo_project --with-personascreate_admin
Section titled “create_admin”Bootstraps the first Django superuser. This runs automatically on container startup, so most operators never invoke it directly. It is idempotent — if a superuser already exists, it exits without changing anything (it never resets an existing password).
Configured entirely through environment variables:
| Variable | Default | Purpose |
|---|---|---|
DJANGO_SUPERUSER_EMAIL | admin@trueppm.dev | Admin email |
DJANGO_SUPERUSER_USERNAME | local part of the email | Admin username |
DJANGO_SUPERUSER_PASSWORD | secure random | Explicit password; if unset, a random one is generated |
TRUEPPM_ADMIN_PASSWORD_FILE | /tmp/trueppm_admin_password | Where the generated password is written (mode 0600) |
When a password is generated rather than supplied, it is written to the password file (not the logs). See Admin Password for how to retrieve it on first boot.
seed_demo_project
Section titled “seed_demo_project”Builds the “Platform Migration” demo project — a complete narrative covering the full hybrid PM flow (charter → decompose → schedule → capacity → stories → sprint planning → execute → forecast → close), with a WBS, a CPM schedule, a baseline, planned/active/closed sprints with burndown, board state, and a retrospective.
| Flag | Effect |
|---|---|
--with-personas | Also creates six demo user logins (Maya, Raj, Diana, Sarah, Carlos, Tom) bound to the project with role-appropriate membership |
The persona password is resolved so a fixed weak password never reaches a public
instance: TRUEPPM_DEMO_PASSWORD env var if set, otherwise demo under
DEBUG=True, otherwise a random token printed once at seed time. A value supplied
via TRUEPPM_DEMO_PASSWORD is not echoed back to stdout — only the generated
random token (or the dev demo default) is printed.
The command is idempotent — re-running clears any prior “Platform Migration” project and re-seeds it from scratch, so it is safe to run repeatedly while exploring.
Sample data & JSON seed
Section titled “Sample data & JSON seed”Three commands cover bundled sample projects and the canonical JSON seed format (ADR-0109). See Sample projects for the user-facing guide.
load_sample_project [--sample <key>] [--owner <username>]— imports a bundled sample seed (default: the Atlas hybrid-large launch demo) and flags its projects as sample data. Idempotent — re-running replaces the sample. The owner defaults to the first superuser.import_seed <path> [--owner <username>] [--create-users]— imports a TruePPM JSON seed file into the database. Re-running with the same file rebuilds the program subtree idempotently on the program slug.--create-usersmints any accounts the seed references that do not yet exist (intended for local demos, not production).export_program <slug> [--out <path>]— exports a program (matched byProgram.code) to the canonical JSON seed format, to--outor stdout. The output round-trips: re-importing it reproduces the program.
Maintenance commands
Section titled “Maintenance commands”These exist for specific operational situations and are not part of routine use:
backfill_in_progress_status— a one-time data-correction command that transitionsNOT_STARTEDtasks whose planned start is in the past toIN_PROGRESS(pinning their actual start to the planned date). Run it once after upgrading from a version that predated automatic in-progress transitions. Pass--dry-runto preview the affected rows without writing. It is idempotent and transaction-safe.prune_forecast_snapshots— applies the tiered retention curve to project forecast snapshots (added in 0.3): keeps every snapshot younger thandaily_days, one-per-ISO-week up toweekly_days, and one-per-calendar-month beyond that. TruePPM runs this automatically via thescheduling.prune_forecast_snapshotsCelery Beat job (nightly, 04:15 UTC); run it manually only to reclaim space on demand or if you operate the API without Beat. Pass--dry-runto report the current snapshot count without deleting. The windows come from theFORECAST_SNAPSHOT_RETENTIONsetting — see Outbox & Record Retention → Forecast snapshots.seed_integration_fixtures— seeds stable fixtures for the integration-test CI job. It is intended for CI and local test runs, not production.flushexpiredtokens— deletes expiredOutstandingToken/BlacklistedTokenrows created by JWT refresh-token rotation and logout (provided by thetoken_blacklistapp). TruePPM runs this automatically via theaccess.flush_expired_blacklisted_tokensCelery Beat job (nightly, 04:30 UTC); run it manually only if you operate the API without Beat. See Security → Blacklist tables and cleanup.