Bottle is a microframework for Python. Raven supports this framework through the WSGI integration.


If you haven’t already, start by downloading Raven. The easiest way is with pip:

pip install raven --upgrade


The first thing you’ll need to do is to disable catchall in your Bottle app:

import bottle

app =
app.catchall = False

Sentry will then act as Middleware:

from raven import Client
from raven.contrib.bottle import Sentry
client = Client('___DSN___')
app = Sentry(app, client)


Once you’ve configured the Sentry application you need only call run with it:


If you want to send additional events, a couple of shortcuts are provided on the Bottle request app object.

Capture an arbitrary exception by calling captureException:

    1 / 0
except ZeroDivisionError:

Log a generic message with captureMessage:'Hello, world!')
In this guide