Skip to content
This repository was archived by the owner on Feb 12, 2026. It is now read-only.

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Flask Example for getsentry

Sentry logo

Introduction

Sentry is an open source tool that provides error tracking to show you every crash in your application as it happens, with the details needed to prioritize, identify, reproduce, and fix each issue.

About This Demo

This demo provides a basic example of instrumenting an app with Sentry. To play with this demo, you'll need to create a Sentry account, and update line 7 of app.py with your <PUBLIC_DSN_KEY> and <PRIVATE_DSN_KEY>. You can find these under Settings > Client Keys in your account.

sentry = Sentry(app, dsn='https://<PUBLIC_DSN_KEY>:<PRIVATE_DSN_KEY>@sentry.io/<PROJECT_ID>')

This sample app has a ZeroDivisionError that will be sent to Sentry. You can check your Sentry dashboard to see these issues reported with their stack trace.

Dashboard Example

Installing Sentry

Details on how to set up Sentry in your own application can be found in our documentation, but here are the basics:

Flask Installation

If you haven’t already, install raven with its explicit Flask dependencies:

pip install raven[flask]

Then, initialize Sentry by passing it your flask app and DSN:

from raven.contrib.flask import Sentry
sentry = Sentry(app, dsn='https://XXXX:[email protected]/XXXX')

Usage

Once you’ve configured the Sentry client it will automatically capture uncaught exceptions within you application.

This will get you started collecting error in your flask app, but Sentry can do a lot more! For more advanced usages and configuration options, you can read our docs.

Contributing

Sentry is open source! Want to get started contributing to Sentry? Our internal documentation has you covered.

Anything Else?

Tweet, email, or visit our forum!