File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313import os , sys
1414import dj_database_url
1515import 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, ...)
1820BASE_DIR = os .path .dirname (os .path .dirname (os .path .abspath (__file__ )))
184186# https://django-rest-auth.readthedocs.io/en/latest/installation.html#registration-optional
185187SITE_ID = 1
186188ACCOUNT_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+ )
Original file line number Diff line number Diff line change @@ -11,4 +11,5 @@ djangorestframework==3.11.0
1111django-rest-auth == 0.9.5
1212django-allauth == 0.42.0
1313django-rest-auth [with_social ]
14- pycodestyle == 2.6.0
14+ pycodestyle == 2.6.0
15+ sentry-sdk == 0.14.4
You can’t perform that action at this time.
0 commit comments