update config template
authorcavaliet
Tue, 17 Jun 2014 10:49:03 +0200
changeset 273 0fa407857df2
parent 272 1c774f7a0341
child 274 64d3e5212e4e
update config template
src/hdabo/config.py.tmpl
--- a/src/hdabo/config.py.tmpl	Tue Jun 17 10:32:57 2014 +0200
+++ b/src/hdabo/config.py.tmpl	Tue Jun 17 10:49:03 2014 +0200
@@ -42,14 +42,68 @@
     }
 }
 
-#HAYSTACK_SEARCH_ENGINE = 'whoosh'
-#HAYSTACK_WHOOSH_PATH = os.path.abspath(BASE_DIR + "../index/").rstrip("/")+"/"
+
+
 HAYSTACK_CONNECTIONS = {
     'default': {
+        # the elasticsearch_backend is probably temporary
         #'ENGINE': 'hdabo.search.french_whoosh_backend.SearchBackend',
         'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
-        'URL': '',
-        'INDEX_NAME': ''
+        'URL': 'http://127.0.0.1:9200/',
+        'INDEX_NAME': 'hdabo',
     },
 }
 
+
+LOG_FILE = os.path.abspath(os.path.join(BASE_DIR,"../../run/log/log.txt"))
+LOG_LEVEL = logging.DEBUG
+LOGGING = {
+    'version': 1,
+    'disable_existing_loggers': False,
+    'formatters' : {
+        'simple' : {
+            'format': "%(asctime)s - %(levelname)s : %(message)s",
+        },
+        'semi-verbose': {
+            'format': '%(levelname)s %(asctime)s %(module)s %(message)s'
+        },                    
+    },
+    'handlers': {
+        'mail_admins': {
+            'level': 'ERROR',
+            'class': 'django.utils.log.AdminEmailHandler'
+        },
+        'stream_to_console': {
+            'level': LOG_LEVEL,
+            'class': 'logging.StreamHandler'
+        },
+        'file': {
+            'level': LOG_LEVEL,
+            'class': 'logging.FileHandler',
+            'filename': LOG_FILE,
+            'formatter': 'semi-verbose',
+        },
+    }            ,
+    'loggers': {
+        'hdabo': {
+            'handlers': ['file'],
+            'level': LOG_LEVEL,
+            'propagate': True,
+        },
+        'hdalab': {
+            'handlers': ['file'],
+            'level': LOG_LEVEL,
+            'propagate': True,
+        },
+#         'django.db.backends':{
+#             'handlers': ['file'],
+#             'level': LOG_LEVEL,
+#             'propagate': True,
+#         },
+#         'django.request': {
+#             'handlers': ['file'],
+#             'level': LOG_LEVEL,
+#             'propagate': True,
+#         },
+    }
+}