File tree Expand file tree Collapse file tree 3 files changed +26
-2
lines changed Expand file tree Collapse file tree 3 files changed +26
-2
lines changed Original file line number Diff line number Diff line change 1
1
django
2
- djangorestframework
2
+ djangorestframework
3
+ sentry-sdk == 0.14.4
Original file line number Diff line number Diff line change 131
131
'DEFAULT_RENDERER_CLASSES' : (
132
132
'rest_framework.renderers.JSONRenderer' ,
133
133
)
134
- }
134
+ }
135
+
136
+
137
+ # Sentry
138
+ # Enable this if on production
139
+ import sentry_sdk
140
+ from sentry_sdk .integrations .django import DjangoIntegration
141
+
142
+ SENTRY_DNS = os .environ .get ('SENTRY_DNS' )
143
+
144
+ sentry_sdk .init (
145
+ dsn = SENTRY_DNS ,
146
+ integrations = [DjangoIntegration ()],
147
+
148
+ # If you wish to associate users to errors (assuming you are using
149
+ # django.contrib.auth) you may enable sending PII data.
150
+ send_default_pii = True
151
+ )
Original file line number Diff line number Diff line change 16
16
from django .contrib import admin
17
17
from django .urls import path , include
18
18
19
+
20
+ def trigger_error (request ):
21
+ division_by_zero = 1 / 0
22
+
19
23
urlpatterns = [
24
+ path ('sentry-debug/' , trigger_error ),
20
25
path ('admin/' , admin .site .urls ),
21
26
path ('api/' , include ('api.urls' )),
22
27
path ('' , include ('frontend.urls' )),
28
+
23
29
]
You can’t perform that action at this time.
0 commit comments