mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 11:26:56 -08:00
adds sentry support to send errors. in sentry.io you can create a free account for small sites.
This commit is contained in:
parent
7cff8ceeac
commit
a0fc14bdd9
4 changed files with 10 additions and 0 deletions
|
@ -36,6 +36,13 @@ def create_app(config_class=Config):
|
|||
app = Flask(__name__)
|
||||
app.config.from_object(config_class)
|
||||
|
||||
if app.config['SENTRY_DSN']:
|
||||
import sentry_sdk
|
||||
sentry_sdk.init(
|
||||
dsn=app.config["SENTRY_DSN"],
|
||||
enable_tracing=True
|
||||
)
|
||||
|
||||
db.init_app(app)
|
||||
migrate.init_app(app, db, render_as_batch=True)
|
||||
login.init_app(app)
|
||||
|
|
|
@ -38,3 +38,4 @@ class Config(object):
|
|||
BOUNCE_USERNAME = os.environ.get('BOUNCE_USERNAME') or ''
|
||||
BOUNCE_PASSWORD = os.environ.get('BOUNCE_PASSWORD') or ''
|
||||
|
||||
SENTRY_DSN = os.environ.get('SENTRY_DSN') or None
|
||||
|
|
|
@ -16,3 +16,4 @@ BOUNCE_USERNAME=''
|
|||
BOUNCE_PASSWORD=''
|
||||
|
||||
FLASK_APP=pyfedi.py
|
||||
SENTRY_DSN=''
|
||||
|
|
|
@ -29,3 +29,4 @@ celery==5.3.6
|
|||
redis==5.0.1
|
||||
Werkzeug==2.3.3
|
||||
pytesseract==0.3.10
|
||||
sentry-sdk==1.40.6
|
||||
|
|
Loading…
Reference in a new issue