Automatic Django database configuration on Heroku.
Project description
# django-heroku-postgresify
Automatic Django database configuration on Heroku.
![What if configuring PostgreSQL is really easy?](https://github.com/rdegges/django-heroku-postgresify/raw/master/assets/postgresify.jpg)
## 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:
``` python
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``
- ``SHARED_DATABASE_URL``
- ``DATABASE_URL``
Your ``DATABASES`` setting would be:
``` python
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
},
}
```
## References
If you're confused, you should probably read:
- [Heroku's Getting Started Guide](http://devcenter.heroku.com/articles/django)
- [Deploy Django's PostgreSQL Section](http://www.deploydjango.com/postgresql/index.html)
Automatic Django database configuration on Heroku.
![What if configuring PostgreSQL is really easy?](https://github.com/rdegges/django-heroku-postgresify/raw/master/assets/postgresify.jpg)
## 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:
``` python
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``
- ``SHARED_DATABASE_URL``
- ``DATABASE_URL``
Your ``DATABASES`` setting would be:
``` python
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
},
}
```
## References
If you're confused, you should probably read:
- [Heroku's Getting Started Guide](http://devcenter.heroku.com/articles/django)
- [Deploy Django's PostgreSQL Section](http://www.deploydjango.com/postgresql/index.html)
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
File details
Details for the file django-heroku-postgresify-0.1.tar.gz
.
File metadata
- Download URL: django-heroku-postgresify-0.1.tar.gz
- Upload date:
- Size: 74.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b702cfcf1542041112eb18229801c539fe19e3493aaf2d4a0fa83d9cef72f20 |
|
MD5 | bc2e8318b1860e787953ecc3c8318e61 |
|
BLAKE2b-256 | 40f4dc29a50ab272d1c3e401a6c7494d19856d7733d535dca4a80abcc838352c |