sentry
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
from back_latienda.settings.base import *
|
||||
import sentry_sdk
|
||||
from sentry_sdk.integrations.django import DjangoIntegration
|
||||
|
||||
from datetime import timedelta
|
||||
|
||||
@@ -7,6 +9,27 @@ DEBUG = False
|
||||
|
||||
ALLOWED_HOSTS = ['*']
|
||||
|
||||
# Sentry
|
||||
sentry_sdk.init(
|
||||
dsn=os.getenv('SENTRY_DSN'),
|
||||
integrations=[DjangoIntegration()],
|
||||
|
||||
# Set traces_sample_rate to 1.0 to capture 100%
|
||||
# of transactions for performance monitoring.
|
||||
# We recommend adjusting this value in production,
|
||||
traces_sample_rate=1.0,
|
||||
|
||||
# If you wish to associate users to errors (assuming you are using
|
||||
# django.contrib.auth) you may enable sending PII data.
|
||||
send_default_pii=True,
|
||||
|
||||
# By default the SDK will try to use the SENTRY_RELEASE
|
||||
# environment variable, or infer a git commit
|
||||
# SHA as release, however you may want to set
|
||||
# something more human-readable.
|
||||
# release="myapp@1.0.0",
|
||||
)
|
||||
|
||||
# Database
|
||||
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
|
||||
|
||||
|
||||
@@ -28,6 +28,10 @@ from .routers import router
|
||||
|
||||
admin.site.site_header = 'LaTiendaCOOP Administration'
|
||||
|
||||
# Trigger sentry test error
|
||||
def trigger_error(request):
|
||||
division_by_zero = 1 / 0
|
||||
|
||||
urlpatterns = [
|
||||
path('admin/', admin.site.urls),
|
||||
path('activate/<uidb64>/<token>/',core_views.activate_user, name='activate_user'),
|
||||
@@ -52,4 +56,5 @@ urlpatterns = [
|
||||
path('api/v1/stats/me/', stat_views.track_user, name='user-tracker'),
|
||||
path('api/v1/autocomplete/category-tag/', product_views.CategoryTagAutocomplete.as_view(), name='category-autocomplete'),
|
||||
path('api/v1/', include(router.urls)),
|
||||
path('sentry-debug/', trigger_error),
|
||||
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||
|
||||
Reference in New Issue
Block a user