From: Tony Mack Date: Fri, 29 Mar 2013 16:19:25 +0000 (-0400) Subject: use setting from planetstack config file X-Git-Tag: 1.0~310 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=281336b025a8ea49554b605f0548c2ed7aa4c6cf;p=plstackapi.git use setting from planetstack config file --- diff --git a/plstackapi/planetstack/settings.py b/plstackapi/planetstack/settings.py index a477452..9af30d9 100644 --- a/plstackapi/planetstack/settings.py +++ b/plstackapi/planetstack/settings.py @@ -9,14 +9,16 @@ ADMINS = ( MANAGERS = ADMINS +from plstackapi.planetstack.config import Config +config = Config() DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. - 'NAME': 'planetstack', # Or path to database file if using sqlite3. + 'NAME': config.db_name, # Or path to database file if using sqlite3. # The following settings are not used with sqlite3: - 'USER': 'postgres', - 'PASSWORD': 'password', - 'HOST': 'localhost', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP. + 'USER': config.db_user, + 'PASSWORD': config.db_password, + 'HOST': config.db_host, # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP. 'PORT': '', # Set to empty string for default. } }