Commit 36ffd264 authored by sim's avatar sim

[REFACT] Move database url in settings to share it

parent d664a75e
......@@ -140,7 +140,10 @@ DATABASES = {
},
}
}
DATABASES['default']['URL'] = \
'postgresql+psycopg2://{USER}:{PASSWORD}@{HOST}:{PORT}/{NAME}'.format(
**DATABASES['default']
)
# Password validation
# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
......
......@@ -10,10 +10,7 @@ from sqlalchemy import delete
def get_engine():
from sqlalchemy import create_engine
url = 'postgresql+psycopg2://{USER}:{PASSWORD}@{HOST}:{PORT}/{NAME}'.format(
**settings.DATABASES['default']
)
return create_engine( url
return create_engine( settings.DATABASES['default']['URL']
, use_native_hstore = True
, json_serializer = json_dumps
, pool_size=20, max_overflow=0
......
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