diff options
Diffstat (limited to 'example_project/settings.py')
| -rw-r--r-- | example_project/settings.py | 37 | 
1 files changed, 28 insertions, 9 deletions
| diff --git a/example_project/settings.py b/example_project/settings.py index 128befe5a..a191b83b3 100644 --- a/example_project/settings.py +++ b/example_project/settings.py @@ -10,6 +10,7 @@ DEBUG_TOOLBAR = False  TEMPLATE_DEBUG = DEBUG  SQL_DEBUG = False  DJANGO_EXTENSIONS = False +USE_SPATIALITE_FOR_TESTS = True  if "test" in sys.argv:      sys.path.insert(0, '..') @@ -155,6 +156,12 @@ INSTALLED_APPS = [  LOGFILE = '' +default_handler = { +    'handlers': ['logfile'], +    'level': 'INFO', +    'propogate': False +} +  LOGGING = {      'version': 1,      'disable_existing_loggers': False, @@ -178,24 +185,24 @@ LOGGING = {          },      },      'loggers': { -        # Again, default Django configuration to email unhandled exceptions          'django.request': { -            'handlers': ['mail_admins'], +            'handlers': ['mail_admins', 'logfile'],              'level': 'ERROR',              'propagate': True,          }, -        # Might as well log any errors anywhere else in Django          'django': {              'handlers': ['logfile'],              'level': 'ERROR',              'propagate': False,          }, -        # Your own app - this assumes all your logger names start with "myapp." -        'chimere': { -            'handlers': ['logfile'], -            'level': 'WARNING',  # Or maybe INFO or DEBUG -            'propogate': False -        }, +        'ishtar_pdl': default_handler, +        'ishtar_common': default_handler, +        'archaeological_files_pdl': default_handler, +        'archaeological_files': default_handler, +        'archaeological_operations': default_handler, +        'archaeological_context_records': default_handler, +        'archaeological_warehouse': default_handler, +        'archaeological_finds': default_handler,      },  } @@ -230,6 +237,10 @@ except ImportError, e:  if 'test' in sys.argv:      SOUTH_TESTS_MIGRATE = False +    if USE_SPATIALITE_FOR_TESTS: +        DATABASES['default']['ENGINE'] = \ +            'django.contrib.gis.db.backends.spatialite' +  PROJECT_SLUG = locals().get('PROJECT_SLUG', 'default')  if LOGFILE: @@ -243,6 +254,11 @@ INTERNAL_IPS = ('127.0.0.1',)  JQUERY_URL = STATIC_URL + "js/jquery.min.js"  JQUERY_UI_URL = STATIC_URL + "js/jquery-ui/" +if DEBUG: +    # make all loggers use the console +    for logger in LOGGING['loggers']: +        LOGGING['loggers'][logger]['handlers'] += ['console'] +  if DJANGO_EXTENSIONS:      INSTALLED_APPS.append('django_extensions') @@ -272,3 +288,6 @@ if SQL_DEBUG:          'level': 'DEBUG',          'handlers': ['console'],      } + +if 'test' in sys.argv: +    PROJECT_SLUG += "-test" | 
