summaryrefslogtreecommitdiff
path: root/example_project/settings.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2016-11-03 15:48:08 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2016-11-03 15:48:08 +0100
commite3541fca4619b6d6458c376067d299d11f15a2b8 (patch)
tree41450cdd1603714842af8a3a99781a88a9bcfdf7 /example_project/settings.py
parentc5a639a8c59c6aa0d9edf1895cdced3cbdebc7a2 (diff)
parentc9608717bfb09c3a52336666358c0cf816c65d76 (diff)
downloadIshtar-e3541fca4619b6d6458c376067d299d11f15a2b8.tar.bz2
Ishtar-e3541fca4619b6d6458c376067d299d11f15a2b8.zip
Merge branch 'master' into v0.9
Diffstat (limited to 'example_project/settings.py')
-rw-r--r--example_project/settings.py37
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"