Skip to content
bliptracedocs

Install an SDK

Django

Django middleware that reports unhandled exceptions with request context.

On this page

The Django adapter adds middleware that catches unhandled exceptions, adds request context and sends them through the Python SDK. Every step is guarded, so it can never slow down or crash your app.

Install from GitHub. Not on PyPI yet. Install the SDK and the adapter in one command. Sources: bliptrace-python, bliptrace-django.

Install

pip install "g8scope @ git+https://github.com/bliptrace/bliptrace-python" \
            "g8scope-django @ git+https://github.com/bliptrace/bliptrace-django"

Configure

# settings.py
import os

MIDDLEWARE = [
    # ... place it high so it sees exceptions from views and inner middleware
    "g8scope_django.middleware.G8ScopeMiddleware",
]

BLIPTRACE = {
    "key": os.environ.get("BLIPTRACE_KEY"),
    "endpoint": "https://ingest.bliptrace.com",
    "environment": "production",
    # optional: "release", "timeout", "max_frames", "max_message",
    #           "ignore_exceptions", "scrub_keys", "base_path", "enabled"
}

Single settings such as BLIPTRACE_KEY = "..." also work and override the dict. Without a key, or with enabled set to False, nothing is captured.

Each report carries request (method, absolute URL, headers without Authorization, Cookie and Set-Cookie) and the signed-in user’s id.

Documentation