skillfed

django-syzygy

Deployment aware tooling for Django migrations.

django-syzygy v1.2.3 108.7K downloads/30d#12,543 on PyPI114
Permissive license MIT License Active released

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-syzygy

uv

uv add django-syzygy

poetry

poetry add django-syzygy

Installing 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

Environment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 4.2Framework :: Django :: 5.0Framework :: Django :: 5.1Framework :: Django :: 5.2Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python Modules

Tags

django migration deploymentzero-downtime database migrationspre-deploy post-deploy migrationsdjango schema change sequencingcontinuous deployment migrationsdjango migration staging
django-migrationszero-downtime-deploymentci-cd

More Python Modules packages