Skip to content

Commit

Permalink
setup sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
nicokant committed Feb 26, 2024
1 parent 73cb2b6 commit 6e1ca73
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ license = {text = "GPLv3"}
[project.optional-dependencies]
prod = [
"gunicorn>=20.1.0",
"sentry-sdk>=1.40.5",
]

[tool]
Expand Down
10 changes: 10 additions & 0 deletions src/nvdb/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

URL = "https://nvdbapiles-v3.atlas.vegvesen.no/"

mapping = str.maketrans(
Expand All @@ -24,3 +26,11 @@ def normalize(value):
if value[0] in "0123456789":
value = "_" + value
return value


if os.getenv('SENTRY_DSN'):
import sentry_sdk
sentry_sdk.init(
dsn=os.getenv('SENTRY_DSN'),
)
print('sentry ready')

0 comments on commit 6e1ca73

Please sign in to comment.