Metadata-Version: 2.4
Name: bug-tracer-client
Version: 0.1.0
Summary: Django middleware client for sending unhandled exceptions to Bug Tracer
Project-URL: Homepage, https://gitlab.com/bug-tracer/bug-tracer-api
Project-URL: Repository, https://gitlab.com/bug-tracer/bug-tracer-api
Project-URL: Issues, https://gitlab.com/bug-tracer/bug-tracer-api/-/issues
Author: Bug Tracer
License: Proprietary
License-File: LICENSE
Keywords: bug-tracker,django,errors,monitoring
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: Django
Classifier: Framework :: Django :: 5.1
Classifier: Intended Audience :: Developers
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: django<6.0,>=4.2
Requires-Dist: requests<3.0.0,>=2.32.0
Description-Content-Type: text/markdown

# bug-tracer-client

`bug-tracer-client` is a reusable Django app that captures unhandled exceptions and sends them to a Bug Tracer backend.

## Installation

```bash
pip install bug-tracer-client
```

## Django setup

Add the app to `INSTALLED_APPS`:

```python
INSTALLED_APPS = [
    # ...
    "bug_tracer_client",
]
```

Add the middleware after authentication middleware so authenticated user context can be included:

```python
MIDDLEWARE = [
    # ...
    "django.contrib.auth.middleware.AuthenticationMiddleware",
    "bug_tracer_client.middleware.BugTracerMiddleware",
]
```

Set the single required setting:

```python
BUG_TRACER_DSN = "bugtracer+https://PUBLIC_KEY@bug-tracer.example.com/1"
```

Supported DSN formats:

- `bugtracer+https://<public_key>@<host>[:<port>]/<project_id>`
- `bugtracer+http://<public_key>@<host>[:<port>]/<project_id>`

## What it sends

The middleware sends a best-effort JSON payload containing:

- exception type and message
- stacktrace frames
- request method and path
- optional authenticated user info

Sensitive fields such as `password`, `token`, `authorization`, and `cookie` are redacted before sending.

## Smoke check

```python
from bug_tracer_client import __version__

print(__version__)
```
