diff --git a/src/collections/_documentation/platforms/python/flask.md b/src/collections/_documentation/platforms/python/flask.md index dcaef29365e17..bed3538dd08b0 100644 --- a/src/collections/_documentation/platforms/python/flask.md +++ b/src/collections/_documentation/platforms/python/flask.md @@ -7,26 +7,35 @@ sidebar_order: 2 The Flask integration adds support for the [Flask Web Framework](http://flask.pocoo.org/). -1. Install `sentry-sdk` from PyPI with the `flask` extra: +Install `sentry-sdk` from PyPI with the `flask` extra: - ```bash - $ pip install --upgrade 'sentry-sdk[flask]=={% sdk_version sentry.python %}' - ``` +```bash +$ pip install --upgrade 'sentry-sdk[flask]=={% sdk_version sentry.python %}' +``` -2. To configure the SDK, initialize it with the integration before or after your app has been initialized: +To configure the SDK, initialize it with the integration before or after your app has been initialized: - ```python - import sentry_sdk - from sentry_sdk.integrations.flask import FlaskIntegration +```python +import sentry_sdk +from sentry_sdk.integrations.flask import FlaskIntegration - sentry_sdk.init( - dsn="___PUBLIC_DSN___", - integrations=[FlaskIntegration()] - ) +sentry_sdk.init( + dsn="___PUBLIC_DSN___", + integrations=[FlaskIntegration()] +) - app = Flask(__name__) - ``` +app = Flask(__name__) +``` +You can easily verify your Sentry installation by creating a route that triggers an error: + +```py +@app.route('/debug-sentry') +def hello_world(): + division_by_zero = 1 / 0 +``` + +Visiting this route will trigger an error that will be captured by Sentry. ## Behavior