To send errors to Rollbar from your Python application you should use the pyrollbar package. Install pyrollbar with pip:

pip install rollbar

Add Rollbar to Your Flask Application

Here's a simple Flask app that demonstrates how you import and initialize the pyrollbar package and initiate an exception handler.

from flask import Flask
app = Flask(__name__)

## Rollbar init code. You'll need the following to use Rollbar with Flask.
## This requires the 'blinker' package to be installed

import os
import rollbar
import rollbar.contrib.flask
from flask import got_request_exception

def init_rollbar():
    """init rollbar module"""
        # access token
        '{{ server_access_token }}',
        # environment name
        # server root directory, makes tracebacks prettier
        # flask already sets up logging

    # send exceptions from `app` to rollbar, using flask's signal system.
    got_request_exception.connect(rollbar.contrib.flask.report_exception, app)

## Simple flask app

def hello():
    print "in hello"
    x = None
    return "Hello World!"

if __name__ == '__main__':

For additional pyrollbar configuration options, see Configuring pyrollbar.