From: Guillaume Pellerin Date: Wed, 8 Jun 2016 20:18:47 +0000 (+0200) Subject: put main HayStack parameters in env X-Git-Tag: 1.6.2^2~6 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=f52fb19aa067f1d7c9f9f23d0a044f57fa97a135;p=telemeta.git put main HayStack parameters in env --- diff --git a/app/settings.py b/app/settings.py index bbb1707b..8869a66f 100644 --- a/app/settings.py +++ b/app/settings.py @@ -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 diff --git a/env/debug.env b/env/debug.env index 7a9fbbcc..38984ec5 100644 --- a/env/debug.env +++ b/env/debug.env @@ -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 index 0452bec4..00000000 --- a/env/index.env +++ /dev/null @@ -1 +0,0 @@ -REINDEX=False diff --git a/env/prod.env b/env/prod.env index 79b9b03c..933f0f2c 100644 --- a/env/prod.env +++ b/env/prod.env @@ -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