From 8045ce9a8ad12f3900a2a92ab374a7f1ca655377 Mon Sep 17 00:00:00 2001 From: Joey Hagedorn Date: Thu, 20 Jul 2006 16:30:11 +0000 Subject: New Reports: pointing settings.py file to read /etc/bcfg2.conf so less initial configuration is needed. git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1975 ce84e21b-d406-0410-9b95-82705330c041 --- reports/brpt/settings.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'reports/brpt/settings.py') diff --git a/reports/brpt/settings.py b/reports/brpt/settings.py index cd93abccf..63a7132ab 100644 --- a/reports/brpt/settings.py +++ b/reports/brpt/settings.py @@ -1,5 +1,8 @@ # Django settings for brpt project. - +from ConfigParser import ConfigParser, NoSectionError, NoOptionError +c = ConfigParser() +c.read(['/etc/bcfg2.conf'])#This needs to be configurable one day somehow +sqlitedbpath = "%s/etc/brpt.sqlite" % c.get('server', 'repository') DEBUG = True TEMPLATE_DEBUG = DEBUG @@ -10,16 +13,10 @@ ADMINS = ( MANAGERS = ADMINS -#DATABASE_ENGINE = 'sqlite3' # 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'. -#DATABASE_NAME = '/Users/joey/anl-mcs/dev/bcfg2/reports/brpt-db' # Or path to database file if using sqlite3. -#DATABASE_USER = '' # Not used with sqlite3. -#DATABASE_PASSWORD = '' # Not used with sqlite3. -#DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. -#DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. -DATABASE_ENGINE = 'mysql' # 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'. -DATABASE_NAME = 'brpt' # Or path to database file if using sqlite3. -DATABASE_USER = 'brptadmin' # Not used with sqlite3. -DATABASE_PASSWORD = 'sekret' # Not used with sqlite3. +DATABASE_ENGINE = 'sqlite3' # 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'. +DATABASE_NAME = sqlitedbpath # Or path to database file if using sqlite3. +DATABASE_USER = '' # Not used with sqlite3. +DATABASE_PASSWORD = '' # Not used with sqlite3. DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. -- cgit v1.2.3-1-g7c22