python import raven client = raven.Client('<your-sentry-dsn>') try: # ... except Exception as e: client.captureException()