Commit fdb3abe3 by Oleg Marshev

Move annottaor-store overwrite to django settings.

parent 9dc382f6
from notesserver import client
client.set_es_settings()
from django.conf import settings
from annotator import es
def set_es_settings():
"""
Overwrite default annotator-store elasticsearch settings.
"""
es.host = getattr(settings, 'ELASTICSEARCH_URL', 'http://localhost:9200')
es.index = getattr(settings, 'ELASTICSEARCH_INDEX', 'edx-notes')
from annotator import es
from .common import * from .common import *
DEBUG = True DEBUG = True
ELASTICSEARCH_URL = 'http://127.0.0.1:9200' ELASTICSEARCH_URL = 'http://127.0.0.1:9200'
ELASTICSEARCH_INDEX = 'edx-notes-dev' ELASTICSEARCH_INDEX = 'edx-notes-dev'
# Overwrite default annotator-store elasticsearch settings.
es.host = ELASTICSEARCH_URL
es.index = ELASTICSEARCH_INDEX
from annotator import es
from .common import * from .common import *
DATABASES = { DATABASES = {
...@@ -12,3 +13,8 @@ INSTALLED_APPS += ('django_nose',) ...@@ -12,3 +13,8 @@ INSTALLED_APPS += ('django_nose',)
ELASTICSEARCH_URL = 'http://127.0.0.1:9200' ELASTICSEARCH_URL = 'http://127.0.0.1:9200'
ELASTICSEARCH_INDEX = 'edx-notes-test' ELASTICSEARCH_INDEX = 'edx-notes-test'
# Overwrite default annotator-store elasticsearch settings.
es.host = ELASTICSEARCH_URL
es.index = ELASTICSEARCH_INDEX
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment