1​. Install pyrollbar with pip:

pip install rollbar

2​. In your settings.py, add 'rollbar.contrib.django.middleware.RollbarNotifierMiddleware' as the last item in MIDDLEWARE_CLASSES:

MIDDLEWARE_CLASSES = (
    # ... other middleware classes ...
    'rollbar.contrib.django.middleware.RollbarNotifierMiddleware',
)

3​. Add the following in settings.py:

ROLLBAR = {
    'access_token': '{{ server_access_token }}',
    'environment': 'development' if DEBUG else 'production',
    'root': BASE_DIR,
}
import rollbar
rollbar.init(**ROLLBAR)

4​. Send a test message:

python manage.py shell
>>> import rollbar
>>> rollbar.report_message("Hello world")