← All platforms

Django error tracking

Django handles a lot for you. When a view still throws, the Sentry integration sends its error report to your Telebugs server.

~/hoofnotes  python -m pip install sentry-sdk
Successfully installed sentry-sdk
~/hoofnotes  nvim + hoofnotes/settings.py
import sentry_sdk
sentry_sdk.init(
# Copy the complete Telebugs DSN, key and path included.
dsn="YOUR_TELEBUGS_DSN",
)
~/hoofnotes  python manage.py shell -c 'import sentry_sdk; sentry_sdk.capture_exception(RuntimeError("Hello from Hoof Notes")); sentry_sdk.flush(timeout=5)'

Space pauses or resumes. R replays. Escape shows the complete setup.

Hang on, I already use Sentry

Keep sentry-sdk and your integrations. Change the DSN to Telebugs and restart the processes that use it. Your reports go to your server, without a Sentry account.

Will it catch failed requests?

Yes. The Django integration reports unhandled request exceptions with a Python backtrace and request context. You can also report an exception your view catches itself.

And the work happening outside a request?

The Sentry Python SDK also has a Celery integration. Management commands can report errors, too. With the SDK connected in those processes, their reports go to the same Telebugs server.