Management commands¶
Midsummer ships a number of Django management commands under */management/commands/.
This page documents what each one actually does, because several carry stale
placeholder help strings (commonly the leftover
"Trims duplicate entries from Stripe to Registrant Datas").
Naming convention¶
Newer commands use the
<app>__<verb>(double-underscore) form so they group by app inmanage.py help(e.g.register__export_reg_timeline).Older commands use a plain name (
init_seed_data,customdomain_*).
Tenant context matters. Commands that touch tenant data run against one tenant’s schema. Use
all_tenants_command <cmd>to run a command across every tenant schema. Commands that readconnection.schema_namemust run from inside the owning tenant’s context.
tenant¶
Note
init_new_tenant and init_seed_data both report
"Initializes Midsummer with Seed Data for Testing" as their help, but they
are not test-only — see the descriptions.
Command |
What it does |
|---|---|
|
Local bootstrap. Creates a default tenant ( |
|
Onboard a real tenant (run in production with |
|
Create a domain on an existing tenant. |
|
Generate member IDs. |
|
Issue/retry Let’s Encrypt certificates for custom domains. Flags: |
|
Renew LE certificates for all custom domains and regenerate the nginx config. |
|
Regenerate the nginx |
event¶
Command |
What it does |
|---|---|
|
Seed the comprehensive default |
|
Interactively prompt for a Stripe API key and associate it with the first event (creates a |
|
Set each event’s |
register¶
Warning
Several register commands are operational reconciliation / one-off scripts
that hit the live Stripe API. They iterate over Event.objects.all() and
mutate is_paid / sent_email flags. Read the code before running in
production, and prefer --dry-run-style preview where the command supports it.
Command |
What it does |
|---|---|
|
Maintained, documented. Export an event’s registration timeline to the year-over-year chart JSON consumed by |
|
Reconcile: registrations marked unpaid that are actually paid in Stripe → mark |
|
Cron-friendly variant of |
|
Diagnostic (read-mostly): counts registrations marked paid that are confirmed paid in Stripe (verifies checkout session → payment intent → charge/refund). Prints per-reg detail. |
|
Reconcile “sent a confirmation but not actually paid”: for paid+emailed regs updated in the last 24h that Stripe says are unpaid → mark |
|
Send registration confirmation emails (via the |
|
Re-send confirmation emails (regenerates the QR code) for paid, unsent registrations. |
|
Event-specific one-off: builds a merchandise summary. Contains hardcoded |
|
Event-specific one-off: CSV export with hardcoded tier UUIDs. |
|
Migration utility: pull registrations from a legacy “v1” system over HTTP and map them (incl. a merch-name mapping table). One-off. |
|
Test utilities for email rendering and QR/multilayer return. One-off/test scaffolding. |
schedule¶
Command |
What it does |
|---|---|
|
Import panels and times from an XLSX file. |
shop¶
Command |
What it does |
|---|---|
|
Export shop order addon selections + form data to an Excel spreadsheet. Args: |
|
Send fulfillment emails for paid shop orders not yet emailed. Args: |
|
Re-run the fulfillment Stripe-payment check across orders. |
staff¶
Command |
What it does |
|---|---|
|
Diagnostic: print the resolved permissions for a user. Args: |
|
Diagnostic: simulate which menu items a user would see. Args: |
misc¶
Command |
What it does |
|---|---|
|
Initialize ZIP codes from a CSV file. |
Adding a new command¶
Create
<app>/management/__init__.pyand<app>/management/commands/__init__.pyif missing.Add
<app>/management/commands/<app>__<verb>.pywith aCommand(BaseCommand).Write an accurate
helpstring (don’t copy the stale placeholder).If it touches tenant data, make it schema-aware and document the tenant- context requirement. Prefer
all_tenants_command-friendliness where sensible.