Skip to content

Commit

Permalink
Proper port mapping for Elasticsearch URL
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmwatson committed Aug 21, 2024
1 parent fcb8dc2 commit 5e11be5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pombola/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration

from urlparse import urlparse

IN_TEST_MODE = False

# Work out where we are to set up the paths correctly and load config
Expand Down Expand Up @@ -294,7 +296,6 @@
PAGINATION_DEFAULT_ORPHANS = 2
PAGINATION_INVALID_PAGE_RAISES_404 = True


# haystack config - interface to search engine
HAYSTACK_CONNECTIONS = {
# 'default': {
Expand All @@ -305,6 +306,7 @@
"default": {
"ENGINE": "haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine",
"URL": os.environ.get("ELASTICSEARCH_URL"),
"PORT": urlparse(os.environ.get("ELASTICSEARCH_URL")).port,
"INDEX_NAME": os.environ.get("ELASTICSEARCH_INDEX", "pombola"),
"EXCLUDED_INDEXES": [],
"TIMEOUT": int(os.environ.get("ELASTICSEARCH_TIMEOUT", 10)),
Expand Down

0 comments on commit 5e11be5

Please sign in to comment.