pip install git+https://github.com/airbrake/airbrake-django.git
Make a section in your settings.py for the airbrake settings for your project:
# Airbrake settings
AIRBRAKE = {
'API_KEY': 'YOUR_PROJECT_API_KEY',
'USE_SSL': True,
'TIMEOUT': 5,
'ENVIRONMENT': 'production',
}
Add airbrake
to INSTALLED_APPS
in your settings.py
INSTALLED_APPS = (
'django.contrib.admin',
# ...
'airbrake'
)
This is basic usage for the airbrake Client
# hello.py
from django.http import HttpResponse
from airbrake.utils.client import Client
def hello_errors(request):
try:
1/0
except Exception as error:
airbrake = Client()
airbrake.notify(error, request)
return HttpResponse("Hello Erorrs")