Giter Club home page Giter Club logo

django-heroku-postgresify's Introduction

django-heroku-postgresify

Automatic Django database configuration on Heroku.

What if configuring PostgreSQL is really easy?

Install

To install django-heroku-postgresify, simply run pip install django-heroku-postgresify and you'll get the latest version installed automatically.

Usage

Modify your Django settings.py file, and set:

from postgresify import postgresify

DATABASES = postgresify()

That's it.

Depending on the Heroku PostgreSQL databases you've got installed, your DATABASES configuration will automatically be setup to use them.

For example, let's assume you've got the following environment variables set on Heroku (you can view the list of all environment variables by running heroku config):

  • HEROKU_POSTGRESQL_BLUE_URL
  • HEROKU_POSTGRESQL_RED_URL
  • HEROKU_SHARED_POSTGRESQL_RED_URL
  • SHARED_DATABASE_URL
  • DATABASE_URL

Your DATABASES setting would be:

DATABASES = {
    'default': {
        # DATABASE_URL configs here
    },
    'SHARED': {
        # SHARED_DATABASE_URL configs here
    },
    'BLUE': {
        # HEROKU_POSTGRESQL_BLUE_URL configs here
    },
    'RED': {
        # HEROKU_POSTGRESQL_RED_URL configs here
    },
    'SHARED_RED': {
        # HEROKU_SHARED_POSTGRESQL_RED_URL configs here
    },
}

References

If you're confused, you should probably read:

Tests

Build Status

Want to run the tests? No problem:

$ git clone git://github.com/rdegges/django-heroku-postgresify.git
$ cd django-heroku-postgresify
$ python setup.py develop
...
$ pip install -r requirements.txt  # Install test dependencies.
$ nosetests
.............
----------------------------------------------------------------------
Ran 13 tests in 0.166s

OK

django-heroku-postgresify's People

Contributors

randalldegges-okta-2 avatar pix0r avatar

Watchers

 avatar James Cloos avatar Jackie avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.