Skip to main content
Build Status Test Coverage PyPI

Django Airbrake provides a logging handler to push exceptions and other errors to airbrakeapp or other airbrake-compatible exception handler services (e.g. aTech Media’s Codebase).

Compatible with all supported Django (LTS) versions. At the moment of writing that’s including 1.11 and 2.0 on Python 2.7(only django1.11), 3.4, 3.5 and 3.6.

Installation

Installation with pip:

$ pip install django-airbrake

Add 'airbrake.handlers.AirbrakeHandler' as a logging handler:

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'filters': {
        'require_debug_false': {
            '()': 'django.utils.log.RequireDebugFalse'
        }
    },
    'handlers': {
        'airbrake': {
            'level': 'WARNING',
            'class': 'airbrake.handlers.AirbrakeHandler',
            'filters': ['require_debug_false'],
            'api_key': '[your-api-key]',
            'env_name': 'develop',
        }
    },
    'loggers': {
        'django.request': {
            'handlers': ['airbrake'],
            'level': 'WARNING',
            'propagate': True,
        },
    }
}

Settings

level (built-in setting) Change the level to 'ERROR' to disable logging of 404 error messages.

api_key (required)

API key provided by the exception handler system.

env_name (required)

Name of the environment (e.g. production, develop, testing)

api_url

To use aTech Media’s Codebase exception system, provide an extra setting api_url with the value 'https://exceptions.codebasehq.com/notifier_api/v2/notices'.

env_variables

List of environment variables that should be included in the error message, defaults to ['DJANGO_SETTINGS_MODULE'].

meta_variables

List of request.META variables that should be included in the error message, defaults to ['HTTP_USER_AGENT', 'HTTP_COOKIE', 'REMOTE_ADDR', 'SERVER_NAME', 'SERVER_SOFTWARE'].

timeout

Timeout in seconds to send the error report, defaults to 30 seconds.

Contributing

  • Fork the repository on GitHub and start hacking.

  • Run the tests.

  • Send a pull request with your changes.

Releasing

The following actions are required to push a new version:

bumpversion [major|minor|patch]
python setup.py sdist bdist_wheel upload
git push

Metadata

Release files for django-airbrake 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-airbrake 1.3.0
File Size Uploaded
django-airbrake-1.3.0.tar.gz 5.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-airbrake 1.3.0
File Interpreter ABI Platform
django_airbrake-1.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.9 kB

Release files / django-airbrake-1.3.0.tar.gz

Download URL django-airbrake-1.3.0.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0dcf55dfc631bbfa54c94888cdf3c7afb6ffdc956631cd4af9142c57c3a029dd
BLAKE2b-256 checksum
How to use checksums
740c261201fdf594aba16a8ba0fb626940f2940b66c54847209080bb700d780d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_airbrake-1.3.0-py3-none-any.whl

Download URL django_airbrake-1.3.0-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
91a35291c64955587340529ec13d7193093f3d1b3a92849eeac528b5a1d35e67
BLAKE2b-256 checksum
How to use checksums
eaba4fde28d3d646d7d416117c2120911f92db8319190bfc448a5a46e862d1b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files

1.2.0

2 release files

1.1.0

1 release file

1.0.0

1 release file

0.3.0

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page