sentry in flask server
This commit is contained in:
parent
cd782db91c
commit
549e65bac1
2 changed files with 4 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
|||
beautifulsoup4==4.6.0
|
||||
blinker==1.4
|
||||
certifi==2017.7.27.1
|
||||
chardet==3.0.4
|
||||
click==6.7
|
||||
|
|
|
@ -3,10 +3,12 @@ import logging
|
|||
from flask import Flask, jsonify, url_for, redirect, abort, request
|
||||
from flask_sqlalchemy import SQLAlchemy
|
||||
from sqlalchemy import text
|
||||
|
||||
from raven.contrib.flask import Sentry
|
||||
import config
|
||||
|
||||
app = Flask(__name__)
|
||||
if not config.DEBUG:
|
||||
sentry = Sentry(app=app, dsn=config.sentry_url, logging=True, level=logging.ERROR)
|
||||
app.config['SQLALCHEMY_DATABASE_URI'] = "mysql+pymysql://{user}:{password}@{host}/{db}?{settings}".format(**config.db)
|
||||
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
|
||||
db = SQLAlchemy(app)
|
||||
|
|
Reference in a new issue