How to configure error tracking with Sentry

Sentry is an open-source error tracker service that either can be rented (SaaS) or self-hosted.


The default way of setting up error tracking of Devilry with Sentry is to use Sentry’s official Django integration.

Make sure Sentry’s Python SDK is installed in Python environment:

$ venv/bin/pip install --upgrade sentry-sdk

Then initialize the Django integration in the file:

import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration


    # Set traces_sample_rate to 1.0 to capture 100%
    # of transactions for performance monitoring.
    # We recommend adjusting this value in production,

    # If you wish to associate users to errors (assuming you are using
    # django.contrib.auth) you may enable sending PII data.

    # By default the SDK will try to use the SENTRY_RELEASE
    # environment variable, or infer a git commit
    # SHA as release, however you may want to set
    # something more human-readable.
    # release="myapp@1.0.0",

Settings (legacy)

Raven was the official legacy Python client for Sentry that some legacy Sentry servers might still require.

Make sure Raven is installed in Python environment:

$ venv/bin/pip install raven

Update the file with Sentry project info and add mapping of Devilry versions:

from devilry import __version__ as devilry_version


INSTALLED_APPS += ['raven.contrib.django.raven_compat']
    'dsn': '',
    'release': devilry_version,

Whats next?

After setting up Sentry you might also want to configure Devilry’s logging: