Skip to content

Commit

Permalink
enabling Rollbar (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbe authored Oct 26, 2020
1 parent 725a94c commit ca56ba8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from flask.views import MethodView
from flask_sqlalchemy import SQLAlchemy
from decouple import config
import rollbar


DEBUG = config("DEBUG", default=False)
Expand All @@ -38,6 +39,14 @@
else:
warnings.warn("GITHUB_AUTH_TOKEN is NOT available. Worry about rate limits.")

ROLLBAR_ACCESS_TOKEN = config("ROLLBAR_ACCESS_TOKEN", default=None)
if ROLLBAR_ACCESS_TOKEN:
rollbar.init(ROLLBAR_ACCESS_TOKEN)
rollbar.report_message("Rollbar is configured correctly")
print("Rollbar enabled.")
else:
print("Rollbar NOT enabled.")

# Set static_folder=None to suppress the standard static server
app = Flask(__name__, static_folder=None)
app.config["SQLALCHEMY_DATABASE_URI"] = config(
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,5 @@ python-decouple==3.3 \
python-dotenv==0.12.0 \
--hash=sha256:81822227f771e0cab235a2939f0f265954ac4763cafd806d845801c863bf372f \
--hash=sha256:92b3123fb2d58a284f76cc92bfe4ee6c502c32ded73e8b051c4f6afc8b6751ed
rollbar==0.15.1 \
--hash=sha256:96b63df27a47232aa16a142d2f5812073f8bf7db2b81c5f7981b9a4d4659468c

0 comments on commit ca56ba8

Please sign in to comment.