summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorTim Laszlo <tim.laszlo@gmail.com>2012-06-01 09:38:57 -0500
committerTim Laszlo <tim.laszlo@gmail.com>2012-06-01 10:13:35 -0500
commit9e1f29b2795d3992d385dae9355bcdcc01901ca5 (patch)
treea9abc3328bd779ddcb5bc5777596f7e776175608 /src/lib
parentb9c8a6c4c0245db0515a164f1b89247688e3b4fa (diff)
downloadbcfg2-9e1f29b2795d3992d385dae9355bcdcc01901ca5.tar.gz
bcfg2-9e1f29b2795d3992d385dae9355bcdcc01901ca5.tar.bz2
bcfg2-9e1f29b2795d3992d385dae9355bcdcc01901ca5.zip
DBStats: Cleanup settings.py
Remove hardcoded django.contrib.auth references. Replace django.contrib.auth.LOGIN_URL with LOGIN_URL Move django import check to the top of the file
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Bcfg2/Server/Reports/settings.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/lib/Bcfg2/Server/Reports/settings.py b/src/lib/Bcfg2/Server/Reports/settings.py
index eb22f29f9..b27348aee 100644
--- a/src/lib/Bcfg2/Server/Reports/settings.py
+++ b/src/lib/Bcfg2/Server/Reports/settings.py
@@ -1,9 +1,12 @@
-import django
import os
import sys
import getopt
import Bcfg2.Options
+try:
+ import django
+except ImportError:
+ raise ImportError('Import of Django module failed. Is Django installed?')
cfile_opt=Bcfg2.Options.CFILE
cfiles=[cfile_opt.default, '/etc/bcfg2-web.conf']
@@ -131,11 +134,7 @@ AUTHENTICATION_BACKENDS = ('django.contrib.auth.backends.ModelBackend',
# The NIS group authorized to login to BCFG2's reportinvg system
AUTHORIZED_GROUP = ''
#create login url area:
-try:
- import django.contrib.auth
-except ImportError:
- raise ImportError('Import of Django module failed. Is Django installed?')
-django.contrib.auth.LOGIN_URL = '/login'
+LOGIN_URL = '/login'
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
@@ -145,7 +144,6 @@ TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates".
# Always use forward slashes, even on Windows.
'/usr/share/python-support/python-django/django/contrib/admin/templates/',
- 'Bcfg2.Server.Reports.reports'
)
if django.VERSION[0] == 1 and django.VERSION[1] < 2: