Skip to content
Bugtail Docs
Menu

Python

Bugtail works with the official Sentry SDK for Python. Django, Flask, FastAPI and Celery are picked up automatically once the SDK is initialised.

Install

pip install sentry-sdk

Configure

Initialise the SDK before your application starts: in settings.py for Django, or in your entry point.

import sentry_sdk

sentry_sdk.init(
    dsn="https://<key>@ingest.bugtail.eu/<project-id>",
    environment="production",
    release="1.4.0",
    traces_sample_rate=0.2,
)

Copy the DSN from your collector under Settings > Projects and collectors. Leave out traces_sample_rate to report errors only.

Send a test event

sentry_sdk.capture_message("Bugtail test event")