Skip to content
This repository was archived by the owner on Jul 15, 2020. It is now read-only.

Commit 0767a94

Browse files
authored
updated Sentry SDK (#623)
1 parent 222600a commit 0767a94

File tree

2 files changed

+13
-19
lines changed

2 files changed

+13
-19
lines changed

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ Pillow==5.3.0
2020
pymarc==3.1.10
2121
python-docx==0.8.7
2222
python-memcached==1.59
23-
raven==6.9.0
2423
requests==2.20.0
2524
six==1.11.0
2625
kombu==4.2.0
26+
sentry-sdk==0.6.5
27+
urllib3[secure]==1.24.1

src/core/settings.py

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
from configparser import ConfigParser
22
import os
33

4+
import sentry_sdk
5+
from sentry_sdk.integrations.django import DjangoIntegration
6+
47
from django.contrib import messages
58

69

@@ -60,7 +63,6 @@
6063
'allauth.socialaccount.providers.google',
6164
'allauth.socialaccount.providers.orcid',
6265
'allauth.socialaccount.providers.twitter',
63-
'raven.contrib.django.raven_compat',
6466
)
6567

6668
MIDDLEWARE = (
@@ -211,11 +213,6 @@
211213
},
212214
},
213215
'handlers': {
214-
'sentry': {
215-
'level': 'ERROR',
216-
'class': 'raven.contrib.django.raven_compat.handlers.SentryHandler',
217-
'tags': {'custom-tag': 'x'},
218-
},
219216
'console': {
220217
'level': 'DEBUG',
221218
'class': 'logging.StreamHandler',
@@ -236,11 +233,6 @@
236233
'handlers': ['console'],
237234
'propagate': False,
238235
},
239-
'raven': {
240-
'level': 'DEBUG',
241-
'handlers': ['console'],
242-
'propagate': False,
243-
},
244236
'sentry.errors': {
245237
'level': 'DEBUG',
246238
'handlers': ['console'],
@@ -323,15 +315,16 @@
323315

324316
SENTRY_DSN = os.getenv(
325317
'SENTRY_DSN',
326-
'https://6f4e629b9384499ea7d6aaa72c820839:'
327-
'33c1f6db04914ee7bf7569f1f3e9cb61@sentry.ubiquity.press/5'
318+
'https://6f4e629b9384499ea7d6aaa72c820839@sentry.ubiquity.press/5'
319+
328320
)
329321
config_file = ConfigParser()
330322
config_file.read('sentry_version.ini')
331323
SENTRY_RELEASE = config_file.get('sentry', 'version', fallback='ERROR')
332324

333-
RAVEN_CONFIG = {
334-
'dsn': SENTRY_DSN,
335-
'release': SENTRY_RELEASE,
336-
'environment': 'production'
337-
}
325+
sentry_sdk.init(
326+
dsn=SENTRY_DSN,
327+
release=SENTRY_RELEASE,
328+
environment=os.getenv('SENTRY_ENV', 'production'),
329+
integrations=[DjangoIntegration()]
330+
)

0 commit comments

Comments
 (0)