Zero-Downtime Multi-Tenancy in Django: From User-centric to Organizations-based Architecture
Talk presented by: Thiago Bellini Ribeiro
During PyCon NL 2026, at 14:05 in Polars

Migrating a production Django app to multi-tenancy without downtime or bugs seems impossible

At Sendcloud, we refactored a 600k+ lines Django app using proxy models, dual FKs, and strategic migrations, with zero downtime, and no bugs.

At SendCloud, we tackled this exact challenge across our Django monolith: 600k+ lines of Python code with continuous production traffic. This talk shares our battle-tested strategy that allowed continuous deployments throughout the migration, and enabled us to move slowly, one Django app at a time.

The approach:

  1. Proxy models as a bridge: Creating an Organization proxy of User, which allowed us to change ForeignKeys in code while maintaining database compatibility
  2. Progressive refactoring: Using helpers like a base class with fallback code, and custom codemods to systematically update models, tests, and business logic across all apps
  3. Dual foreign keys: Adding new FK constraints pointing to the organization table alongside existing user FKs, using PostgreSQL’s NOT VALID to avoid table locks
  4. Seamless cutover: Swapping from proxy to real Organization model without SQL execution, then dropping old constraints
Practical information
When: October 15th 2026
A map showing where the Jaarbeurs Utrecht is located
Where: Jaarbeurs Utrecht
Jaarbeursplein 6
3521 AL Utrecht
The Netherlands
More info
Follow us: