]> git.parisson.com Git - telemeta.git/commitdiff
put main HayStack parameters in env
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Wed, 8 Jun 2016 20:18:47 +0000 (22:18 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Wed, 8 Jun 2016 20:18:47 +0000 (22:18 +0200)
app/settings.py
env/debug.env
env/index.env [deleted file]
env/prod.env

index bbb1707bacd5f82f9814a7c66fffb9b400685283..8869a66f55632c2520e70fff1478b81fa56a80c5 100644 (file)
@@ -290,7 +290,6 @@ LOGGING = {
 }
 
 BROKER_URL = env('BROKER_URL')
-
 CELERY_IMPORTS = ("timeside.server.tasks",)
 CELERY_RESULT_BACKEND = 'djcelery.backends.database:DatabaseBackend'
 CELERY_TASK_SERIALIZER = 'json'
@@ -303,8 +302,8 @@ HAYSTACK_CONNECTIONS = {
     'default': {
         #'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
         'ENGINE': 'telemeta.util.backend.CustomElasticEngine',
-        'URL': 'http://search:9200/',
-        'INDEX_NAME': 'haystack',
+        'URL': env('HAYSTACK_URL'),
+        'INDEX_NAME': env('HAYSTACK_INDEX_NAME'),
         'INLUDE_SPELLING': True,
         'EXCLUDED_INDEXES': ['telemeta.search_indexes.LocationIndex',
                              'telemeta.search_indexes.LocationAliasIndex',
@@ -315,8 +314,8 @@ HAYSTACK_CONNECTIONS = {
     'autocomplete': {
         # 'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
         'ENGINE': 'telemeta.util.backend.CustomElasticEngine',
-        'URL': 'http://search:9200/',
-        'INDEX_NAME': 'haystackauto',
+        'URL': env('HAYSTACK_URL'),
+        'INDEX_NAME': env('HAYSTACK_INDEX_NAME_AUTOCOMPLETE'),
         'INLUDE_SPELLING': True,
         'EXCLUDED_INDEXES': ['telemeta.search_indexes.MediaItemIndex',
                              'telemeta.search_indexes.MediaCollectionIndex',
@@ -325,6 +324,7 @@ HAYSTACK_CONNECTIONS = {
                              ]
     },
 }
+
 #HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'
 HAYSTACK_SIGNAL_PROCESSOR = 'telemeta.util.search_signals.RealTimeCustomSignal'
 HAYSTACK_SEARCH_RESULTS_PER_PAGE = 50
index 7a9fbbcc2efd668f22107e8e9316a87bd0755b0f..38984ec5aaed27a00572d5862443af7f556ba4cd 100644 (file)
@@ -1,4 +1,4 @@
-# -- MYSQL DATABASE
+## MYSQL DATABASE
 
 ENGINE=django.db.backends.mysql
 MYSQL_ROOT_PASSWORD=mysecretpassword
@@ -6,16 +6,26 @@ MYSQL_DATABASE=telemeta
 MYSQL_USER=telemeta
 MYSQL_PASSWORD=mysecretpassword
 
-# -- DJANGO
+## DJANGO
 
 DEBUG=True
-
 SECRET_KEY=ghv8us2587n97dq&w$c((o5rj_$-9#d-8j#57y_a9og8wux1h7
 
+## CELERY
+
 # replace broker by localhost if you start your app outside docker-compose
 BROKER_URL=redis://broker:6379/0
 
-# If this is True, all tasks will be executed locally by blocking until the task returns.
+# if this is True, all tasks will be executed locally by blocking until the task returns.
 CELERY_ALWAYS_EAGER=False
 
-REINDEX=True
+## HAYSTACK
+
+# if this is True, the search index will be rebuild
+REINDEX=False
+
+HAYSTACK_URL=http://search:9200/
+
+# change index names if hosting multiple search containers
+HAYSTACK_INDEX_NAME=telemeta
+HAYSTACK_INDEX_NAME_AUTOCOMPLETE=telemeta_auto
diff --git a/env/index.env b/env/index.env
deleted file mode 100644 (file)
index 0452bec..0000000
+++ /dev/null
@@ -1 +0,0 @@
-REINDEX=False
index 79b9b03c6239b9a2ad24cd497901a7e223dbf65b..933f0f2c64e605dd81fc582658fd65b475389d50 100644 (file)
@@ -1,4 +1,4 @@
-# -- MYSQL DATABASE
+## MYSQL DATABASE
 
 ENGINE=django.db.backends.mysql
 MYSQL_ROOT_PASSWORD=mysecretpassword
@@ -6,14 +6,26 @@ MYSQL_DATABASE=telemeta
 MYSQL_USER=telemeta
 MYSQL_PASSWORD=mysecretpassword
 
-# -- DJANGO
+## DJANGO
 
 DEBUG=False
-
 SECRET_KEY=ghv8us2587n97dq&w$c((o5rj_$-9#d-8j#57y_a9og8wux1h7
 
+## CELERY
+
 # replace broker by localhost if you start your app outside docker-compose
 BROKER_URL=redis://broker:6379/0
 
-# If this is True, all tasks will be executed locally by blocking until the task returns.
+# if this is True, all tasks will be executed locally by blocking until the task returns.
 CELERY_ALWAYS_EAGER=False
+
+## HAYSTACK
+
+# if this is True, the search index will be rebuild
+REINDEX=False
+
+HAYSTACK_URL=http://search:9200/
+
+# change index names if hosting multiple search containers
+HAYSTACK_INDEX_NAME=telemeta
+HAYSTACK_INDEX_NAME_AUTOCOMPLETE=telemeta_auto