🔧(backend) add posthog configuration

We add the posthog configuration to the project.
We will expose the posthog configuration to the
frontend.
This commit is contained in:
Anthony LC
2025-01-21 14:16:00 +01:00
committed by Anthony LC
parent 70048328d1
commit c018c6fcf5
3 changed files with 8 additions and 0 deletions

View File

@@ -1124,6 +1124,7 @@ class ConfigView(drf.views.APIView):
"ENVIRONMENT", "ENVIRONMENT",
"FRONTEND_THEME", "FRONTEND_THEME",
"MEDIA_BASE_URL", "MEDIA_BASE_URL",
"POSTHOG_KEY",
"LANGUAGES", "LANGUAGES",
"LANGUAGE_CODE", "LANGUAGE_CODE",
"SENTRY_DSN", "SENTRY_DSN",

View File

@@ -20,6 +20,7 @@ pytestmark = pytest.mark.django_db
CRISP_WEBSITE_ID="123", CRISP_WEBSITE_ID="123",
FRONTEND_THEME="test-theme", FRONTEND_THEME="test-theme",
MEDIA_BASE_URL="http://testserver/", MEDIA_BASE_URL="http://testserver/",
POSTHOG_KEY={"id": "132456", "host": "https://eu.i.posthog-test.com"},
SENTRY_DSN="https://sentry.test/123", SENTRY_DSN="https://sentry.test/123",
) )
@pytest.mark.parametrize("is_authenticated", [False, True]) @pytest.mark.parametrize("is_authenticated", [False, True])
@@ -41,5 +42,6 @@ def test_api_config(is_authenticated):
"LANGUAGES": [["en-us", "English"], ["fr-fr", "French"], ["de-de", "German"]], "LANGUAGES": [["en-us", "English"], ["fr-fr", "French"], ["de-de", "German"]],
"LANGUAGE_CODE": "en-us", "LANGUAGE_CODE": "en-us",
"MEDIA_BASE_URL": "http://testserver/", "MEDIA_BASE_URL": "http://testserver/",
"POSTHOG_KEY": {"id": "132456", "host": "https://eu.i.posthog-test.com"},
"SENTRY_DSN": "https://sentry.test/123", "SENTRY_DSN": "https://sentry.test/123",
} }

View File

@@ -390,6 +390,11 @@ class Base(Configuration):
None, environ_name="FRONTEND_THEME", environ_prefix=None None, environ_name="FRONTEND_THEME", environ_prefix=None
) )
# Posthog
POSTHOG_KEY = values.DictValue(
None, environ_name="POSTHOG_KEY", environ_prefix=None
)
# Crisp # Crisp
CRISP_WEBSITE_ID = values.Value( CRISP_WEBSITE_ID = values.Value(
None, environ_name="CRISP_WEBSITE_ID", environ_prefix=None None, environ_name="CRISP_WEBSITE_ID", environ_prefix=None