summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/settings.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/Bcfg2/settings.py')
-rw-r--r--src/lib/Bcfg2/settings.py26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/lib/Bcfg2/settings.py b/src/lib/Bcfg2/settings.py
index cfb515136..395bb97d6 100644
--- a/src/lib/Bcfg2/settings.py
+++ b/src/lib/Bcfg2/settings.py
@@ -10,6 +10,13 @@ try:
except ImportError:
HAS_DJANGO = False
+# required for reporting
+try:
+ import south
+ has_south = True
+except:
+ has_south = False
+
DATABASES = dict()
# Django < 1.2 compat
@@ -91,6 +98,7 @@ def read_config(cfile=DEFAULT_CONFIG, repo=None, quiet=False):
TIME_ZONE = setup['time_zone']
DEBUG = setup['django_debug']
+ DEBUG = True
TEMPLATE_DEBUG = DEBUG
if DEBUG:
print("Warning: Setting web_debug to True causes extraordinary memory "
@@ -101,6 +109,14 @@ def read_config(cfile=DEFAULT_CONFIG, repo=None, quiet=False):
else:
MEDIA_URL = '/site_media'
+ if HAS_DJANGO and django.VERSION[0] == 1 and django.VERSION[1] < 3:
+ CACHE_BACKEND = 'locmem:///'
+ else:
+ CACHES = {
+ 'default': {
+ 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
+ }
+ }
# initialize settings from /etc/bcfg2-web.conf or /etc/bcfg2.conf, or
# set up basic defaults. this lets manage.py work in all cases
@@ -123,9 +139,13 @@ INSTALLED_APPS = (
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
- 'Bcfg2.Server.Reports.reports',
- 'Bcfg2.Server'
+ 'Bcfg2.Server',
)
+if has_south:
+ INSTALLED_APPS = INSTALLED_APPS + (
+ 'south',
+ 'Bcfg2.Reporting',
+ )
# Imported from Bcfg2.Server.Reports
MEDIA_ROOT = ''
@@ -158,7 +178,7 @@ MIDDLEWARE_CLASSES = (
)
# TODO - move this to a higher root and dynamically import
-ROOT_URLCONF = 'Bcfg2.Server.Reports.urls'
+ROOT_URLCONF = 'Bcfg2.Reporting.urls'
# TODO - this isn't usable
# Authentication Settings