Skip to main content

Management commands

Run inside the stack with docker compose exec django python manage.py <command>, or on the host with .venv\Scripts\python.exe manage.py <command>. Most accept --help.

warning

Several of these are destructive (truncate, delete_user, delete_bible, reset_collections). They run against whatever DB_HOST points at, which in dev is the shared database.

Data and curriculum (EMAW/management/commands/)​

CommandPurpose
import_dataUpsert books, weeks, questions, quiet times and memory verses from book_info.json
export_dataWrite front_end_book_info.json for the clients
truncateDestructive reset of the curriculum tables

Users and accounts​

CommandPurpose
activate_user --user <id>Mark a user active (skip verification)
delete_userDelete a user and their data by email
migrate_usersConvert usernames to hashed emails (historical)
purge_pending_accountsRemove accounts that never verified
print_usersList users
test_graph_emailSend a test email through the Graph backend

Memory verses​

CommandPurpose
add_119, add_marriage_commitment_all, add_wwwamapAdd a specific verse for all users
assign_versesSet MemoryVerse.book
backfill_umv_from_collectionsCreate missing UserMemoryVerse rows
bulk_update_versesBulk-edit verse content and hash
create_collections / reset_collectionsCreate or reset default collections
mark_universalMark verses with id below 55 as universal
update_content_hash, update_versionsRecompute hash and version fields

Bibles​

CommandAppPurpose
load_bibleEMAWLoad a version into the legacy SQL tables from CSV
delete_bibleEMAWDelete a legacy version
create_version_schema, export_version_listEMAWWrite the JSON metadata the clients bundle
print_unique_books, print_versions, update_book_abbreviationsEMAWInspection and cleanup
build_bible_sqlitebiblesExport SQLite files from the legacy tables
build_sqlite_from_csvbiblesBuild SQLite directly from media/bibles/*.csv
register_bible_buildbiblesCreate BibleBuild rows and optionally mark them current (what the mobile app's manifest serves)
embed_bible_versesbible_searchGenerate embeddings with OpenAI into Qdrant
load_bible_embeddingsbible_searchLoad the parquet into Qdrant (first run on every machine)

CRM​

CommandPurpose
import_planning_center, import_planning_center_lists, import_planning_center_notes, import_planning_center_activitiesPlanning Center importers (need PLANNING_CENTER_*; refuse to run after PCO_MIGRATION_COMPLETE=1 without --force). Runbook: docs/PCO_CUTOVER.md
pco_import_reportReconciliation report for an import run
geocode_contactsGeocode contacts missing coordinates
link_contacts_to_usersLink contacts to app users by email hash
backfill_contact_activitiesRebuild the activity timeline

Store, shipping, Deposco​

CommandAppPurpose
seed_store_catalogstoreCreate products from the UltraCart list
sync_stripe_catalogstorePush products and prices to Stripe
import_fulfillment_shipmentsstoreImport historic shipments for fulfilment-based shipping prices
rebuild_shipping_ratesstoreRecompute ShippingRate / ShippingRegionFactor
link_orders_to_contactsstoreLink paid orders to CRM contacts
quote_shippingshippingQuote a sample address and items from the CLI
deposco_checkdeposcoVerify credentials and that SKUs exist in Deposco
deposco_submit_orderdeposcoSubmit one order by hand
deposco_sync, deposco_sync_inventorydeposcoRun the beat syncs on demand
deposco_import_orders, deposco_link_contactsdeposcoImport all-channel order history and link to contacts

Events, resources, campaigns​

CommandAppPurpose
link_registrations_to_contactseventsLink paid registrations to contacts
import_sanity_resourcesresourcesOne-time migration of resources from Sanity
acs_send_testcampaignsSend a test email through ACS
backfill_email_imagescampaignsRegister images referenced by templates