Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request #40 from DonHaul/prep-dev
Browse files Browse the repository at this point in the history
opensearch: fetching enviroment variables for prod enviroments
  • Loading branch information
drjova authored Jun 10, 2024
2 parents 7fb39e4 + cdc7996 commit db4280c
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions config/settings/production.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import logging

import sentry_sdk
from opensearch_dsl import connections
from sentry_sdk.integrations.celery import CeleryIntegration
from sentry_sdk.integrations.django import DjangoIntegration
from sentry_sdk.integrations.logging import LoggingIntegration
Expand Down Expand Up @@ -197,5 +198,27 @@
SPECTACULAR_SETTINGS["SERVERS"] = [ # noqa: F405
{"url": "https://example.com", "description": "Production server"},
]

# Opensearch
# ------------------------------------------------------------------------------
OPENSEARCH_DSL = {
"default": {
"hosts": [env("OPENSEARCH_HOST")],
"http_auth": (
env("OPENSEARCH_USER"),
env("OPENSEARCH_PASSWORD"),
),
"port": 443,
"use_ssl": True,
"verify_certs": False,
"timeout": 30,
"http_compress": True,
"url_prefix": "es",
},
}

# Workaround because it wont add the connection settings automatically
connections.configure(default=OPENSEARCH_DSL["default"])

# Your stuff...
# ------------------------------------------------------------------------------

0 comments on commit db4280c

Please sign in to comment.