Skip to content

Commit

Permalink
Add sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
kylase committed Jun 27, 2020
1 parent 270da61 commit 5b29dc2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion requirements/prod.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ gensim==3.4.0
flask_restful==0.3.6
flask-restful-swagger-2==0.35
flask-swagger-ui==3.6.0
raven[flask]==6.9.0
sentry-sdk[flask]==0.15.1
12 changes: 9 additions & 3 deletions run.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import os
import sentry_sdk

from flask.helpers import get_debug_flag
from raven.contrib.flask import Sentry
from sentry_sdk.integrations.flask import FlaskIntegration

from app import create_app
from app.settings import ProductionConfig, DevelopmentConfig

CONFIG = DevelopmentConfig if get_debug_flag() else ProductionConfig

app = create_app(CONFIG)
sentry_sdk.init(
dsn=os.getenv('SENTRY_DSN'),
integrations=[FlaskIntegration()]
)

sentry = Sentry(app)
app = create_app(CONFIG)

if __name__ == '__main__':
app.run(host=os.getenv('HOST', default='0.0.0.0'),
Expand Down

0 comments on commit 5b29dc2

Please sign in to comment.