Skip to content

Commit

Permalink
Configuring sentry on retail backend project
Browse files Browse the repository at this point in the history
  • Loading branch information
matmsa27 committed Jan 15, 2025
1 parent a4339ad commit bb4737e
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 2 deletions.
59 changes: 57 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ drf-yasg = "^1.21.7"
django-cors-headers = "^4.4.0"
celery = "^5.1.2"
django-redis = "^5.2.0"
sentry-sdk = "^2.20.0"

[tool.poetry.group.dev.dependencies]
flake8 = "^7.1.0"
Expand Down
8 changes: 8 additions & 0 deletions retail/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
from pathlib import Path

import environ
import sentry_sdk

from sentry_sdk.integrations.django import DjangoIntegration


# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
Expand Down Expand Up @@ -43,6 +47,10 @@

CSRF_TRUSTED_ORIGINS = [f"https://*.{SERVICE_HOST}"]

sentry_sdk.init(
dsn=env.str("SENTRY_DSN", default=""),
integrations=[DjangoIntegration()],
)

REST_FRAMEWORK = {
"DEFAULT_AUTHENTICATION_CLASSES": [],
Expand Down

0 comments on commit bb4737e

Please sign in to comment.