From: Tony Mack Date: Fri, 10 May 2013 21:15:32 +0000 (-0400) Subject: pull some values from planetstack config file X-Git-Tag: 1.0~56 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=e485af3140ea57c36693f69a2e68b80967390e80;hp=2ff8622350fbfafb6e0cf1e949d85ea0978e7589;p=plstackapi.git pull some values from planetstack config file --- diff --git a/planetstack/planetstack/settings.py b/planetstack/planetstack/settings.py index 8970c42..29e6285 100644 --- a/planetstack/planetstack/settings.py +++ b/planetstack/planetstack/settings.py @@ -1,4 +1,6 @@ # Django settings for planetstack project. +from config import Config +config = Config() DEBUG = True TEMPLATE_DEBUG = DEBUG @@ -12,11 +14,11 @@ MANAGERS = ADMINS 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': 'admin', - '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. } }