mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 23:10:16 +00:00
DATABASES uses update() instead of being set explicitly, to preserve options
This commit is contained in:
+4
-2
@@ -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':
|
||||
|
||||
Reference in New Issue
Block a user