Skip to main content

Helper methods to configure Django database and static files in a PAAS environment.

Project description

Helper methods to configure Django database and static files in a PAAS environment. The platforms currently supported are: Heroko, OpenShift, dotCloud and Gondor


Basic example


    'default': dj_paas_env.database.config()

This example tries to figure out the database configuration from the following environment variables: DATABASE_URL, HEROKU_POSTGRESQL_<color>_URL, CLEARDB_DATABASE_URL, OPENSHIFT_POSTGRESQL_DB_URL, OPENSHIFT_MYSQL_DB_URL, GONDOR_DATABASE_URL and dotcloud environment file.

Local database

For develop/testing in local environments, it’s recomend to use a default configuration. With this option the application works in local and remote (PAAS) environments:

    'default': dj_paas_env.database.config(default='mysql://user@pass:localhost/testdb')

Develop with SQLite

    'default': dj_paas_env.database.sqlite_dev()

PAAS provider detection

The method dj_paas_env.provider.detect() returns the provider name (heroku, openshift, dotcloud, gondor) where the application is running:

>>> import dj_paas_env
>>> dj_paas_env.provider.detect()

Project details

Download files

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

Source Distributions (10.0 kB view hashes)

Uploaded source

dj-paas-env-0.6.1.tar.gz (5.7 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page