django-syzygy
Deployment aware tooling for Django migrations.
What it is and what it does
django-syzygy is a Django application that restructures how migrations are sequenced during deployment. It addresses a core problem in continuous deployment: when you roll out code changes, old and new code versions must coexist briefly, but Django's default migrations don't account for this. For example, adding a field with a default value removes the database-level default immediately, breaking inserts from the old code that doesn't know the field exists yet.
The package introduces the concept of prerequisite (pre-deploy) and postponed (post-deploy) migrations. It automatically splits problematic operations—like field additions and removals—into multiple stages, and provides a `--pre-deploy` flag to the migrate command so your CI/CD pipeline can run migrations before code rollout, then apply deferred changes after. It's tested on PostgreSQL, SQLite, and MySQL, though MySQL's lack of transactional DDL means failed migrations may require manual intervention.
Use it for:
- Running migrations before deploying new code in a continuous deployment pipeline to prevent schema conflicts
- Safely adding fields to models without breaking existing application instances still using the old schema
- Removing fields in stages so both old and new code versions can operate during a gradual rollout
- Enforcing safe migration sequencing through system checks that prevent mixing pre- and post-deploy operations in a single migration
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Automates Django database migration deployment by splitting operations into pre-deployment and post-deployment stages, preventing schema conflicts when old and new code versions coexist during rollout.
Yes, if you use Django in a continuous deployment environment where old and new code versions coexist during rollouts. The package solves a real problem that standard Django migrations don't handle well. Install friction is low and maintenance is active. Not necessary for single-instance deployments or applications that tolerate brief downtime during migrations. MySQL users should be aware that transactional DDL is not supported, requiring manual intervention on failed migrations.
Install
django-syzygy on PyPI
pip
pip install django-syzygyuv
uv add django-syzygypoetry
poetry add django-syzygyInstalling django-syzygy
Before you install
Low install friction with a single Django dependency. Actively maintained with recent commits and a stable release history since 2021. Overrides Django's default migration commands, so compatibility with other migration-related packages may require custom command inheritance.
License in practice
MIT License permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.
Quickstart
pip install django-syzygy
# settings.py
INSTALLED_APPS = [
...
'syzygy',
...
]
# In your CI/CD pipeline:
# Before rollout: python manage.py migrate --pre-deploy
# After rollout: python manage.py migrate
Overrides Django's default makemigrations and migrate commands; if using other migration-related packages, you may need to define custom command classes that inherit from all involved packages' command definitions.
Verify before relying
- Whether the package handles all Django 5.2 migration edge cases or if further testing is needed
- Performance impact on large migration sets or complex schemas
- Rollback behavior and recovery procedures when migrations fail mid-deployment
Package facts
| License | MIT License (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — Django |
| Maintenance | actively maintained — 154 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 108,702/month — #12,543 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: django_syzygy-1.2.3-py2.py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
django-safemigrateAdds a safemigrate command to Django that…
permissive · top 15,000 on PyPI
django-pg-zero-downtime-migrationsProvides a Django database backend for…
permissive · top 15,000 on PyPI
yoyo-migrationsYoyo-migrations is a database schema migration…
permissive · top 15,000 on PyPI
django-add-default-valueProvides a Django migration operation to set…
permissive · top 15,000 on PyPI
atlas-provider-sqlalchemyConnects SQLAlchemy models to Atlas to…
unclear · top 15,000 on PyPI
schemachangeschemachange is a Python tool that manages…
permissive · top 15,000 on PyPI
django-linear-migrationsEnforces linear migration history in Django…
permissive · top 5,000 on PyPI
sqlalchemy-migrateProvides database schema migration management…
permissive · top 15,000 on PyPI
peewee-migratePeewee Migrate provides a command-line and…
permissive · top 15,000 on PyPI
alembicAlembic generates and manages database schema…
permissive · top 1,000 on PyPI