Created
December 16, 2013 23:37
-
-
Save alexlouden/7997026 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# psql: | |
# CREATE DATABASE mydatabase; | |
# \connect mydatabase | |
# CREATE EXTENSION postgis; | |
# GEOS from buildpack | |
try: | |
GEOS_LIBRARY_PATH = os.path.join(os.environ['GEOS_LIBRARY_PATH'], 'libgeos_c.so') | |
GDAL_LIBRARY_PATH = os.path.join(os.environ['GDAL_LIBRARY_PATH'], 'libgdal.so') | |
except: | |
pass | |
# Local development | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.contrib.gis.db.backends.postgis', | |
'NAME': 'mydatabase', | |
'USER': '', | |
'PASSWORD': '', | |
'HOST': 'localhost', | |
'PORT': '', | |
} | |
} | |
# Heroku | |
HEROKU = bool(os.environ.get('DATABASE_URL')) | |
CI_TEST = bool(os.environ.get('CIRCLECI')) | |
if HEROKU: | |
import dj_database_url | |
DATABASES['default'] = dj_database_url.config() | |
DATABASES['default']['ENGINE'] = 'django.contrib.gis.db.backends.postgis' | |
POSTGIS_VERSION = (2, 1, 0) | |
# CI Testing (Circle CI) | |
if CI_TEST: | |
DATABASES['default']['NAME'] = 'circle_test' | |
DATABASES['default']['USER'] = 'ubuntu' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment