diff options
author | David Dahl <dahl@mcs.anl.gov> | 2006-10-11 21:54:30 +0000 |
---|---|---|
committer | David Dahl <dahl@mcs.anl.gov> | 2006-10-11 21:54:30 +0000 |
commit | 018f2351a8b7a3f9f2ed3b449a5b4744dd5ea19d (patch) | |
tree | a1f2d5da620900f103f67c56599aba2b9fc6ce28 /src/lib/Server/Hostbase/settings.py | |
parent | 998b31229cdd91a1fd0610596e83addfe28e6e0c (diff) | |
download | bcfg2-018f2351a8b7a3f9f2ed3b449a5b4744dd5ea19d.tar.gz bcfg2-018f2351a8b7a3f9f2ed3b449a5b4744dd5ea19d.tar.bz2 bcfg2-018f2351a8b7a3f9f2ed3b449a5b4744dd5ea19d.zip |
added test dir and nose tests and made settings more dynamic
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2430 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Hostbase/settings.py')
-rw-r--r-- | src/lib/Server/Hostbase/settings.py | 58 |
1 files changed, 36 insertions, 22 deletions
diff --git a/src/lib/Server/Hostbase/settings.py b/src/lib/Server/Hostbase/settings.py index 5176167fe..da8f625ca 100644 --- a/src/lib/Server/Hostbase/settings.py +++ b/src/lib/Server/Hostbase/settings.py @@ -1,48 +1,64 @@ # Django settings for Hostbase project. - DEBUG = True TEMPLATE_DEBUG = DEBUG - ADMINS = ( # ('Your Name', 'your_email@domain.com'), ) - MANAGERS = ADMINS - -DATABASE_ENGINE = 'mysql' # 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'. -DATABASE_NAME = 'hosttest' # Or path to database file if using sqlite3. -DATABASE_USER = 'hosttest' # Not used with sqlite3. -DATABASE_PASSWORD = 'marathon' # Not used with sqlite3. -DATABASE_HOST = 'mysql.mcs.anl.gov' # Set to empty string for localhost. Not used with sqlite3. -DATABASE_PORT = '3306' # Set to empty string for default. Not used with sqlite3. - -# Local time zone for this installation. All choices can be found here: -# http://www.postgresql.org/docs/current/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE -TIME_ZONE = 'America/Chicago' +CFG_TYPE = 'mcs' + +if CFG_TYPE == 'mcs': + # 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'. + DATABASE_ENGINE = 'mysql' + # Or path to database file if using sqlite3. + DATABASE_NAME = 'hosttest' + # Not used with sqlite3. + DATABASE_USER = 'hosttest' + # Not used with sqlite3. + DATABASE_PASSWORD = 'marathon' + # Set to empty string for localhost. Not used with sqlite3. + DATABASE_HOST = 'mysql.mcs.anl.gov' + # Set to empty string for default. Not used with sqlite3. + DATABASE_PORT = '3306' + # Local time zone for this installation. All choices can be found here: + # http://www.postgresql.org/docs/current/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE + TIME_ZONE = 'America/Chicago' + +if CFG_TYPE == 'environ': + import os + # 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'. + DATABASE_ENGINE = os.envoiron['bcfg_db_engine'] + # Or path to database file if using sqlite3. + DATABASE_NAME = os.environ['bcfg_db_name'] + # Not used with sqlite3. + DATABASE_USER = os.environ['bcfg_db_user'] + # Not used with sqlite3. + DATABASE_PASSWORD = os.environ['bcfg_db_password'] + # Set to empty string for localhost. Not used with sqlite3. + DATABASE_HOST = os.environ['bcfg_db_host'] + # Set to empty string for default. Not used with sqlite3. + DATABASE_PORT = os.environ['bcfg_db_port'] + # Local time zone for this installation. All choices can be found here: + # http://www.postgresql.org/docs/current/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE + TIME_ZONE = os.environ['bcfg_time_zone'] # Language code for this installation. All choices can be found here: # http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes # http://blogs.law.harvard.edu/tech/stories/storyReader$15 LANGUAGE_CODE = 'en-us' - SITE_ID = 1 - # Absolute path to the directory that holds media. # Example: "/home/media/media.lawrence.com/" MEDIA_ROOT = '' - # URL that handles the media served from MEDIA_ROOT. # Example: "http://media.lawrence.com" MEDIA_URL = '' - # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a # trailing slash. # Examples: "http://foo.com/media/", "/media/". ADMIN_MEDIA_PREFIX = '/media/' - # Make this unique, and don't share it with anybody. SECRET_KEY = '*%=fv=yh9zur&gvt4&*d#84o(cy^-*$ox-v1e9%32pzf2*qu#s' - # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.load_template_source', @@ -78,5 +94,3 @@ INSTALLED_APPS = ( 'Hostbase.hostbase', ) -DEFAULT_MX = 'mailgw.mcs.anl.gov' -PRIORITY = 30 |