31 lines
952 B
Python
31 lines
952 B
Python
from django.conf.global_settings import *
|
|
from passerelle.default_settings import *
|
|
from django.core.exceptions import ImproperlyConfigured
|
|
|
|
import os
|
|
import logging
|
|
|
|
if 'DJANGO_CONFIG_FILE' in os.environ:
|
|
logging.getLogger('passerelle').debug('Loading setting file %r', os.environ['DJANGO_CONFIG_FILE'])
|
|
execfile(os.environ['DJANGO_CONFIG_FILE'])
|
|
|
|
if 'DATABASES' not in globals():
|
|
logging.getLogger('passerelle').error('Unable to boot: You must define a DATABASES in your settings')
|
|
raise ImproperlyConfigured('You must define a DATABASES variable in your settings')
|
|
|
|
|
|
if DEBUG:
|
|
# Load debug toolbar when available
|
|
try:
|
|
import debug_toolbar
|
|
except:
|
|
pass
|
|
else:
|
|
logging.getLogger('passerelle').debug('loading debug_toolbar')
|
|
MIDDLEWARE_CLASSES += (
|
|
'debug_toolbar.middleware.DebugToolbarMiddleware',
|
|
)
|
|
INSTALLED_APPS += (
|
|
'debug_toolbar',
|
|
)
|