pull some values from planetstack config file
authorTony Mack <tmack@paris.CS.Princeton.EDU>
Fri, 10 May 2013 21:15:32 +0000 (17:15 -0400)
committerTony Mack <tmack@paris.CS.Princeton.EDU>
Fri, 10 May 2013 21:15:32 +0000 (17:15 -0400)
planetstack/planetstack/settings.py

index 8970c42..29e6285 100644 (file)
@@ -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.
     }
 }