diff options
author | Tim Laszlo <tim.laszlo@gmail.com> | 2010-10-14 15:28:58 -0500 |
---|---|---|
committer | Sol Jerome <sol.jerome@gmail.com> | 2010-11-02 20:35:17 -0500 |
commit | 2435042c73537a368cda92a4a01c9009d3aaffbe (patch) | |
tree | 4cf551ce778394d93b54bc02c8c5502b1ad7e433 /src/lib/Server/Reports/settings.py | |
parent | feed7f02aeda0b8abe4a3a521e6ab13081c84232 (diff) | |
download | bcfg2-2435042c73537a368cda92a4a01c9009d3aaffbe.tar.gz bcfg2-2435042c73537a368cda92a4a01c9009d3aaffbe.tar.bz2 bcfg2-2435042c73537a368cda92a4a01c9009d3aaffbe.zip |
web reports: new skin
Diffstat (limited to 'src/lib/Server/Reports/settings.py')
-rw-r--r-- | src/lib/Server/Reports/settings.py | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/lib/Server/Reports/settings.py b/src/lib/Server/Reports/settings.py index 59d29114d..81220c0e3 100644 --- a/src/lib/Server/Reports/settings.py +++ b/src/lib/Server/Reports/settings.py @@ -1,3 +1,5 @@ +import django + # Django settings for bcfg2 reports project. from ConfigParser import ConfigParser, NoSectionError, NoOptionError c = ConfigParser() @@ -62,7 +64,9 @@ MEDIA_ROOT = '' # URL that handles the media served from MEDIA_ROOT. # Example: "http://media.lawrence.com" -MEDIA_URL = '' +MEDIA_URL = '/site_media' +if c.has_option('statistics', 'web_prefix'): + MEDIA_URL = c.get('statistics', 'web_prefix').rstrip('/') + MEDIA_URL # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a # trailing slash. @@ -109,9 +113,26 @@ 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/', - '/usr/share/bcfg2/Reports/templates' + 'Bcfg2.Server.Reports.reports' ) +if django.VERSION[0] == 1 and django.VERSION[1] < 2: + TEMPLATE_CONTEXT_PROCESSORS = ( + 'django.core.context_processors.auth', + 'django.core.context_processors.debug', + 'django.core.context_processors.i18n', + 'django.core.context_processors.media', + 'django.core.context_processors.request' + ) +else: + TEMPLATE_CONTEXT_PROCESSORS = ( + 'django.contrib.auth.context_processors.auth', + 'django.core.context_processors.debug', + 'django.core.context_processors.i18n', + 'django.core.context_processors.media', + 'django.core.context_processors.request' + ) + INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', |