$ pip install raven
python
import raven
python
from raven import Client
client = Client(
dsn='https://public_key:secret_key@host:port/1'
)
python
try:
except Exception as e:
client.captureException()
python
client.captureMessage('Hello, Raven!')
python
with client.user_context({
'name': 'John Doe',
'email': 'john@example.com'
}):
client.captureMessage('User action')
python
client.captureMessage('Extra data', extra={
'request_id': '123456',
'ip_address': '127.0.0.1'
})