Django
Installing Airbrake in a Django application
The pybrake
package makes it quick and easy to monitor your Django app’s
performance. It only takes a few minutes to start collecting real performance data so let’s jump right in!
Key Features
- Automatically report exceptions from your django app
- Support for Airbrake Performance Monitoring
- Simple to install and configure
Installation & Configuration
Set up the Pybrake’s middleware and project config for your web application
Step 1: Install the latest version of pybrake
Airbrake for Django uses our official Python notifier pybrake. To install run:
pip install -U pybrake
Step 2: Configure the Airbrake Django middleware
First, configure parameters in settings.py
:
AIRBRAKE = dict(
project_id=123,
project_key='FIXME',
)
Next, activate the Airbrake middleware:
MIDDLEWARE = [
...
'pybrake.middleware.django.AirbrakeMiddleware',
]
Finally, configure the airbrake logging handler:
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'airbrake': {
'level': 'ERROR',
'class': 'pybrake.LoggingHandler',
},
},
'loggers': {
'app': {
'handlers': ['airbrake'],
'level': 'ERROR',
'propagate': True,
},
},
}
Now you are ready to start reporting errors and performance monitoring to Airbrake from your Django app. Please look into sample example to get more idea.
Additional Settings
Please visit our Pybrake overview for details on useful features like:
- Sending errors to Airbrake
- Sending errors synchronously
- Adding custom params
- Ignoring notices
- Filtering/Blocking keys data
- Logging integration
- Sending route stats
- Sending route stats
- Sending route breakdowns
- Sending query stats
- Sending queue stats
Troubleshoot
If you have any questions or concerns, please address them here.