Добавил Sentry
This commit is contained in:
@@ -14,3 +14,5 @@ DB_USER=""
|
||||
DB_PASSWORD=""
|
||||
DB_HOST=""
|
||||
DB_PORT=""
|
||||
|
||||
SENTRY_DSN=""
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
from django.urls import path
|
||||
|
||||
from core.views import index
|
||||
from core.views import index, sentry_debug
|
||||
|
||||
|
||||
app_name = "index"
|
||||
|
||||
urlpatterns = [
|
||||
path("", index, name="main_index"),
|
||||
path("sentry-debug/", sentry_debug, name="sentry_debug"),
|
||||
]
|
||||
|
||||
@@ -3,3 +3,7 @@ from django.shortcuts import render
|
||||
|
||||
def index(request, *args, **kwargs):
|
||||
return render(request, "index.html")
|
||||
|
||||
|
||||
def sentry_debug(request):
|
||||
division_by_zero = 1 / 0 # noqa
|
||||
|
||||
@@ -182,3 +182,17 @@ AXES_COOLOFF_TIME = 0.25 # in hours
|
||||
AXES_LOCK_OUT_AT_FAILURE = True
|
||||
AXES_VERBOSE = True
|
||||
AXES_LOCKOUT_PARAMETERS = [["ip_address", "user_agent"]]
|
||||
|
||||
|
||||
# Sentry Configuration
|
||||
SENTRY_DSN = os.getenv("SENTRY_DSN", "")
|
||||
if SENTRY_DSN and not DEBUG:
|
||||
import sentry_sdk
|
||||
from sentry_sdk.integrations.django import DjangoIntegration
|
||||
|
||||
sentry_sdk.init(
|
||||
dsn=SENTRY_DSN,
|
||||
integrations=[DjangoIntegration()],
|
||||
traces_sample_rate=1.0,
|
||||
send_default_pii=True
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user