This repository was archived by the owner on Aug 26, 2024. It is now read-only.
File tree 4 files changed +16
-2
lines changed
4 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 3
3
from starlette .staticfiles import StaticFiles
4
4
from starlette .responses import HTMLResponse
5
5
from starlette .templating import Jinja2Templates
6
+ from sentry_sdk .integrations .asgi import SentryAsgiMiddleware
7
+ import sentry_sdk
6
8
import uvicorn
7
9
8
10
9
11
config = Config ()
10
12
DEBUG = config ("DEBUG" , cast = bool , default = False )
13
+ SENTRY_DSN = config ("DEBUG" , cast = str , default = "" )
14
+
15
+ if SENTRY_DSN :
16
+ sentry_sdk .init (dsn = SENTRY_DSN )
17
+
11
18
12
19
templates = Jinja2Templates (directory = "templates" )
13
20
14
21
app = Starlette (debug = DEBUG )
22
+
23
+ if SENTRY_DSN :
24
+ app .add_middleware (SentryAsgiMiddleware )
25
+
15
26
app .mount ("/static" , StaticFiles (directory = "statics" ), name = "static" )
16
27
17
28
Original file line number Diff line number Diff line change @@ -10,8 +10,9 @@ aiofiles==0.4.*
10
10
jinja2==2.*
11
11
starlette==0.12.*
12
12
uvicorn==0.9.*
13
+ sentry-sdk==0.12.*
13
14
14
15
# Testing (For consistency we still want to install these to production tho.)
15
- black==19.*
16
+ black
16
17
pytest==5.*
17
18
requests==2.*
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ py==1.8.0
19
19
pyparsing == 2.4.2
20
20
pytest == 5.2.0
21
21
requests == 2.22.0
22
+ sentry-sdk == 0.12.3
22
23
six == 1.12.0
23
24
starlette == 0.12.9
24
25
toml == 0.10.0
Original file line number Diff line number Diff line change @@ -13,8 +13,9 @@ if ! [ -f .env ] ; then
13
13
fi
14
14
15
15
if [ " $1 " = " --update" ]; then
16
+ rm -f requirements.txt
16
17
${BIN_PATH} pip install -U -r requirements.base
17
- scripts/ freeze
18
+ ${BIN_PATH} pip freeze > requirements.txt
18
19
else
19
20
${BIN_PATH} pip install -U -r requirements.txt
20
21
fi
You can’t perform that action at this time.
0 commit comments