Skip to content

Commit

Permalink
move bugsnag config
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsheehan committed Aug 18, 2013
1 parent 70e91a4 commit 27cf6d3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
23 changes: 12 additions & 11 deletions requestbin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,18 @@ def callback(status, headers, exc_info=None):
app.secret_key = config.FLASK_SESSION_SECRET_KEY
app.root_path = os.path.abspath(os.path.dirname(__file__))

import bugsnag
from bugsnag.flask import handle_exceptions
bugsnag.configure(
api_key="58db8ba0ea5f19fa6dae397cba8e7900",
project_root=app.root_path,
# 'production' is a magic string for bugsnag, rest are arbitrary
release_stage = config.REALM.replace("prod", "production"),
notify_release_stages=["production", "test"],
use_ssl = True
)
handle_exceptions(app)
if config.BUGSNAG_KEY:
import bugsnag
from bugsnag.flask import handle_exceptions
bugsnag.configure(
api_key=config.BUGSNAG_KEY,
project_root=app.root_path,
# 'production' is a magic string for bugsnag, rest are arbitrary
release_stage = config.REALM.replace("prod", "production"),
notify_release_stages=["production", "test"],
use_ssl = True
)
handle_exceptions(app)

from filters import *
app.jinja_env.filters['status_class'] = status_class
Expand Down
4 changes: 4 additions & 0 deletions requestbin/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

REDIS_PREFIX = "requestbin"

BUGSNAG_KEY = ""

if REALM == 'prod':
DEBUG = True
ROOT_URL = "http://requestb.in"
Expand All @@ -38,6 +40,8 @@
REDIS_PASSWORD = url_parts.password
REDIS_DB = url_parts.fragment

BUGSNAG_KEY = os.environ.get("BUGSNAG_KEY", BUGSNAG_KEY)

IGNORE_HEADERS = """
X-Varnish
X-Forwarded-For
Expand Down

0 comments on commit 27cf6d3

Please sign in to comment.