Skip to main content

A Django Migrations extension providing a framework for Zero Downtime Continuous Delivery.

Project description

# django-zerodowntime

[![CircleCI](https://circleci.com/gh/rentlytics/django-zerodowntime.svg?style=svg)](https://circleci.com/gh/rentlytics/django-zerodowntime)

Management commands to help Django users build & deploy their projects with low interruption for their users. This method is often called Zero Downtime Continous Delivery, or ZDCD.

Database schema migrations are the most common cause of application downtime during a deployment. Some operations like adding a NULLed column or an entirely new table do not affect the application as it continues to run. Other operations such as removing/renaming a column/table can cause the deployed code to fail in unexpected ways. Ultimately you will have to remove or rename existing schema, but most deployments do not require downtime so the code can be updated without interrupting users.

This project was developed for use at [Rentlytics](http://rentlytics.com), [here is a copy](./Rentlytics-ZDCD.pdf) of the presentation which brought this project to life.

## Commands

### check_migrations Checks all pending migrations against the DEFAULT Django database for zero downtime deployment compatibility. A migration is considered compatible when it contains only: CreateModel, AddField, or AlterModelOptions operations. An exception is when AddField is used to create a new column with a default value provided. Providing a default value requires filling all existing rows with the value, which can be an expensive operation.

### insert_git_hooks Adds or modifies the git commit-msg hook at .git/hooks/commit-msg to execute check_migrations before each commit is saved to git’s history. When check_migrations exits with a non-zero exit code, an error message will be output listing the incompatible migration operations. In the event that incompatible migrations are to be allowed, you can add [allow-unsafe-migrations] to your commit message, which skips this check.

## Usage Guide * [Heroku + CircleCI](./examples/heroku/)

History

0.1.0 (2016-06-02)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-zerodowntime-0.2.6.tar.gz (24.3 kB view details)

Uploaded Source

Built Distribution

django_zerodowntime-0.2.6-py2.py3-none-any.whl (7.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-zerodowntime-0.2.6.tar.gz.

File metadata

File hashes

Hashes for django-zerodowntime-0.2.6.tar.gz
Algorithm Hash digest
SHA256 92fead93176d510e719fdd56c6f9f64c24f3247c22ef7462646f8da3019925eb
MD5 254672d83314cfbbd36c3f29df4ef94b
BLAKE2b-256 f8133c68b532f59e60dd2168bbd6988fa31026d71285e062963f3e3b4c3b6966

See more details on using hashes here.

File details

Details for the file django_zerodowntime-0.2.6-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_zerodowntime-0.2.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e276c53465a60db4d1e07cad656a67607d41a19837645823469b26c0e0872e67
MD5 572aea420ad949bc6eff89b7c66915ea
BLAKE2b-256 f2d1747be48c0e2164e76833ba1293caaae68bb5a66caacc49925903eec02947

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page