Skip to main content

# 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.

Metadata

Release files for django-zerodowntime 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-zerodowntime 0.3.0
File Size Uploaded
django-zerodowntime-0.3.0.tar.gz 24.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-zerodowntime 0.3.0
File Interpreter ABI Platform
django_zerodowntime-0.3.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 32.8 kB

Release files / django-zerodowntime-0.3.0.tar.gz

Download URL django-zerodowntime-0.3.0.tar.gz
Size 24.8 kB
Tags Source
SHA-256 checksum
How to use checksums
af2d4ed1e8e85b529456362e8132ca4b22968237b18b08fd319aa2ac2cc38eff
BLAKE2b-256 checksum
How to use checksums
108ddf1c944db30d6185038aeb4c455f31251fe58613fb90e6ae63f64b8f27b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_zerodowntime-0.3.0-py2.py3-none-any.whl

Download URL django_zerodowntime-0.3.0-py2.py3-none-any.whl
Size 8.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
5888b3745315eeff151be5fc07ec49c4dcd48388065b0c7e10ace3eb3fd9c43c
BLAKE2b-256 checksum
How to use checksums
7e0187321a7d48ff2510af1e0b5168edfee363452e0bf826427e865e1176f8fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page