From 507222316cedff353871ee93ad4ed2a0ddb791dc Mon Sep 17 00:00:00 2001 From: poduck Date: Tue, 9 Dec 2025 14:29:08 -0500 Subject: [PATCH] fix: Add django.setup() to deploy script plugin seeding The python -c one-liner wasn't initializing Django's app registry, causing AppRegistryNotReady error when calling get_tenant_model(). --- deploy.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deploy.sh b/deploy.sh index 128bd18..cc41249 100755 --- a/deploy.sh +++ b/deploy.sh @@ -184,6 +184,8 @@ if [[ "$SKIP_MIGRATE" != "true" ]]; then echo ">>> Seeding/updating platform plugins for all tenants..." docker compose -f docker-compose.production.yml exec -T django sh -c 'export DATABASE_URL=postgres://\${POSTGRES_USER}:\${POSTGRES_PASSWORD}@\${POSTGRES_HOST}:\${POSTGRES_PORT}/\${POSTGRES_DB} && python -c " +import django +django.setup() from django_tenants.utils import get_tenant_model from django.core.management import call_command Tenant = get_tenant_model()