⏱ Estimated Time To Completion: 5 minutes

Please make sure you’ve installed Decipher for your frontend before continuing.

1

Install the SDK

Decipher uses the Sentry SDK to collect runtime data from your application. Installation is simple:

Bash
pip install --upgrade "sentry-sdk[flask]"

The Flask integration will be automatically enabled when you initialize the Sentry SDK, provided the flask package is included in your application’s dependencies.

The Python SDK will integrate with Flask for all your applications. It connects to Flask’s signals rather than the app object itself.

2

Initialize the SDK

Initialize the SDK as soon as possible in your application’s runtime.

import sentry_sdk

sentry_sdk.init(
    dsn="YOUR_DECIPHER_DSN", # Get this at https://app.getdecipher.com/settings
    traces_sample_rate=1.0,
    profiles_sample_rate=1.0,
)

You can get the dsn parameter by logging into Decipher with your work email. On the Settings page, select a new project name and click “Create New Project”. Decipher will generate a DSN to that you can paste.

3

Test the integration

Throw an error anywhere in your application and Decipher will automatically capture the exception and runtime alongside it.

For example:

from flask import Flask

sentry_sdk.init(...)   # same as above

app = Flask(__name__)

@app.route("/")
def hello_world():
    1 / 0  # raises an error
    return "<p>Hello, World!</p>"

Check out the Decipher dashboard to see information about your captured error. Decipher will automatically analyze and group your errors to highlight the important, high-impact ones.