Commit 6a05ef1d authored by Dave Paola's avatar Dave Paola

DATABASES uses update() instead of being set explicitly, to preserve options

parent 743effb5
......@@ -104,13 +104,15 @@ try:
if os.environ.has_key('DATABASE_URL'):
url = urlparse.urlparse(os.environ['DATABASE_URL'])
DATABASES['default'] = {
# We use update here to preserve other keys we
# don't care about (like OPTIONS)
DATABASES['default'].update({
'NAME': url.path[1:],
'USER': url.username,
'PASSWORD': url.password,
'HOST': url.hostname,
'PORT': url.port,
}
})
if url.scheme == 'postgres':
DATABASES['default']['ENGINE'] = 'django.db.backends.postgresql_psycopg2'
if url.scheme == 'mysql':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment