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().
This commit is contained in:
poduck
2025-12-09 14:29:08 -05:00
parent c5c108c76f
commit 507222316c

View File

@@ -184,6 +184,8 @@ if [[ "$SKIP_MIGRATE" != "true" ]]; then
echo ">>> Seeding/updating platform plugins for all tenants..." 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 " 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_tenants.utils import get_tenant_model
from django.core.management import call_command from django.core.management import call_command
Tenant = get_tenant_model() Tenant = get_tenant_model()