-
Notifications
You must be signed in to change notification settings - Fork 0
/
apps.py
25 lines (20 loc) · 801 Bytes
/
apps.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from django.apps import AppConfig
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from elasticsearch_dsl.connections import connections as es_connections
class SearchConfig(AppConfig):
"""Initialize the kuma.search application."""
name = "kuma.search"
verbose_name = _("Search")
def ready(self):
"""Configure kuma.search after models are loaded."""
# Register signal handlers
from . import signal_handlers # noqa
# Configure Elasticsearch connections for connection pooling.
es_connections.configure(
default={"hosts": settings.ES_URLS},
indexing={
"hosts": settings.ES_URLS,
"timeout": settings.ES_INDEXING_TIMEOUT,
},
)