Skip to content

Commit b9b3660

Browse files
authored
Merge: sentry 연결 설정
[Feature/sentry] sentry 연결 설정
2 parents 17aefde + b59e493 commit b9b3660

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

config/settings/local.py

+7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from datetime import timedelta
33

44
import environ
5+
import sentry_sdk
56

67
from .base import *
78

@@ -199,6 +200,12 @@
199200
},
200201
}
201202

203+
# sentry_sdk.init(
204+
# dsn=env("SENTRY_DSN"),
205+
# traces_sample_rate=env.float("SENTRY_TRACES_SAMPLE_RATE"),
206+
# profiles_sample_rate=env.float("SENTRY_PROFILES_SAMPLE_RATE"),
207+
# )
208+
202209
# 커스텀 설정 # TODO
203210
FRONT_CONFIRM_URL = env("FRONT_CONFIRM_URL")
204211
GOOGLE_OAUTH2_URL = env("GOOGLE_OAUTH2_URL")

config/settings/prod.py

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from ast import literal_eval
22
from datetime import timedelta
33

4+
import sentry_sdk
5+
46
from tools.secrets import get_secret
57

68
from .base import *
@@ -141,6 +143,12 @@
141143
# URL_FRONT = ENV["URL_FRONT"] # TODO 이건 어디서 나온 설정인지?
142144
# EMAIL_CONFIRMATION_AUTHENTICATED_REDIREDT_URL = "/"
143145

146+
sentry_sdk.init(
147+
dsn=ENV["SENTRY_DSN"],
148+
traces_sample_rate=float(ENV["SENTRY_TRACES_SAMPLE_RATE"]),
149+
profiles_sample_rate=float(ENV["SENTRY_PROFILES_SAMPLE_RATE"]),
150+
)
151+
144152
# 커스텀 설정 # TODO
145153
FRONT_CONFIRM_URL = ENV["FRONT_CONFIRM_URL"]
146154
GOOGLE_OAUTH2_URL = ENV["GOOGLE_OAUTH2_URL"]

config/urls.py

+2-18
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,3 @@
1-
"""
2-
URL configuration for config project.
3-
4-
The `urlpatterns` list routes URLs to views. For more information please see:
5-
https://docs.djangoproject.com/en/5.0/topics/http/urls/
6-
Examples:
7-
Function views
8-
1. Add an import: from my_app import views
9-
2. Add a URL to urlpatterns: path('', views.home, name='home')
10-
Class-based views
11-
1. Add an import: from other_app.views import Home
12-
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
13-
Including another URLconf
14-
1. Import the include() function: from django.urls import include, path
15-
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
16-
"""
17-
181
from django.conf import settings
192
from django.conf.urls.static import static
203
from django.contrib import admin
@@ -25,8 +8,9 @@
258
SpectacularSwaggerView,
269
)
2710

11+
2812
urlpatterns = [
29-
path("admin/", admin.site.urls),
13+
path("api/admin/", admin.site.urls),
3014
path("api/schema/", SpectacularAPIView.as_view(), name="schema"),
3115
path("api/schema/swagger-ui/", SpectacularSwaggerView.as_view(url_name="schema"), name="swagger-ui"),
3216
path("api/schema/redoc/", SpectacularRedocView.as_view(url_name="schema"), name="redoc"),

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ django-stubs-ext = "^5.0.0"
3232
django-filter = "^24.2"
3333
whitenoise = "^6.6.0"
3434
requests = "^2.32.0"
35+
sentry-sdk = {extras = ["django"], version = "^2.3.1"}
3536

3637

3738
[tool.poetry.group.dev.dependencies]

0 commit comments

Comments
 (0)