|
1 | 1 | from configparser import ConfigParser
|
2 | 2 | import os
|
3 | 3 |
|
| 4 | +import sentry_sdk |
| 5 | +from sentry_sdk.integrations.django import DjangoIntegration |
| 6 | + |
4 | 7 | from django.contrib import messages
|
5 | 8 |
|
6 | 9 |
|
|
60 | 63 | 'allauth.socialaccount.providers.google',
|
61 | 64 | 'allauth.socialaccount.providers.orcid',
|
62 | 65 | 'allauth.socialaccount.providers.twitter',
|
63 |
| - 'raven.contrib.django.raven_compat', |
64 | 66 | )
|
65 | 67 |
|
66 | 68 | MIDDLEWARE = (
|
|
211 | 213 | },
|
212 | 214 | },
|
213 | 215 | 'handlers': {
|
214 |
| - 'sentry': { |
215 |
| - 'level': 'ERROR', |
216 |
| - 'class': 'raven.contrib.django.raven_compat.handlers.SentryHandler', |
217 |
| - 'tags': {'custom-tag': 'x'}, |
218 |
| - }, |
219 | 216 | 'console': {
|
220 | 217 | 'level': 'DEBUG',
|
221 | 218 | 'class': 'logging.StreamHandler',
|
|
236 | 233 | 'handlers': ['console'],
|
237 | 234 | 'propagate': False,
|
238 | 235 | },
|
239 |
| - 'raven': { |
240 |
| - 'level': 'DEBUG', |
241 |
| - 'handlers': ['console'], |
242 |
| - 'propagate': False, |
243 |
| - }, |
244 | 236 | 'sentry.errors': {
|
245 | 237 | 'level': 'DEBUG',
|
246 | 238 | 'handlers': ['console'],
|
|
323 | 315 |
|
324 | 316 | SENTRY_DSN = os.getenv(
|
325 | 317 | 'SENTRY_DSN',
|
326 |
| - 'https://6f4e629b9384499ea7d6aaa72c820839:' |
327 |
| - '33c1f6db04914ee7bf7569f1f3e9cb61@sentry.ubiquity.press/5' |
| 318 | + 'https://6f4e629b9384499ea7d6aaa72c820839@sentry.ubiquity.press/5' |
| 319 | + |
328 | 320 | )
|
329 | 321 | config_file = ConfigParser()
|
330 | 322 | config_file.read('sentry_version.ini')
|
331 | 323 | SENTRY_RELEASE = config_file.get('sentry', 'version', fallback='ERROR')
|
332 | 324 |
|
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