Skip to content

Commit 14f5b8d

Browse files
Merge pull request #39 from Web-Multi-Media/sentry
Add sentry
2 parents 4876e57 + 5a212fa commit 14f5b8d

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

backend/StreamingServer/settings.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
import os, sys
1414
import dj_database_url
1515
import subprocess
16+
import sentry_sdk
17+
from sentry_sdk.integrations.django import DjangoIntegration
1618

1719
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
1820
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@@ -184,3 +186,15 @@
184186
# https://django-rest-auth.readthedocs.io/en/latest/installation.html#registration-optional
185187
SITE_ID = 1
186188
ACCOUNT_EMAIL_VERIFICATION = 'none'
189+
190+
191+
sentry_dsn = os.getenv('SENTRY_DSN', None)
192+
if sentry_dsn:
193+
sentry_sdk.init(
194+
dsn=sentry_dsn,
195+
integrations=[DjangoIntegration()],
196+
197+
# If you wish to associate users to errors (assuming you are using
198+
# django.contrib.auth) you may enable sending PII data.
199+
send_default_pii=True
200+
)

backend/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ djangorestframework==3.11.0
1111
django-rest-auth==0.9.5
1212
django-allauth==0.42.0
1313
django-rest-auth[with_social]
14-
pycodestyle==2.6.0
14+
pycodestyle==2.6.0
15+
sentry-sdk==0.14.4

0 commit comments

Comments
 (0)