Skip to main content


Project description

# django-brancher This is a Django app to help manage branches that contain database migrations. It basically creates a new database from a template of the existing default database and then uses that new branch-specific database for ./ migrate and ./ runserver commands.

This is not intended for production use.

## Example

### Requirements
  • git

  • postgres

  • your postgres user has createdb permission (alter role <user> createdb;)

  • django-brancher installed via pip

  • brancher added to your Django installed apps

### Sample workflow This is an example work flow to create a new branch, run migrations on it, start runserver, and finally delete it. ` git checkout -b funtime <code up some migrations and run makemigrations> python branch_mk python branch_it migrate python branch_it runserver python branch_rm `

## Commands

### Run command Run a command with DATABASES[‘default’][‘NAME’] set to DATABASES[‘default’][‘NAME’]_`$ git rev-prse –abbrev-ref HEAD`

` python branch_it diffsettings `

### List List all branched databases available ` python branch_ls `

### Create Makes a database based off the current default database given a unique name based on the default database name plus the branch name (e.g. $ git rev-prse –abbrev-ref HEAD) ` $ python branch_mk `

### Delete Deletes the branched database based off the result of $ git rev-prse –abbrev-ref HEAD ` $ python branch_rm `

Project details

Release history Release notifications | RSS feed

This version


Download files

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

Source Distribution

django-brancher-0.1.tar.gz (4.0 kB view hashes)

Uploaded source

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