Sentry-python: [Tech Support] How to use this with django?

Created on 25 Sep 2018  Â·  11Comments  Â·  Source: getsentry/sentry-python

Where exactly am I supposed to put sentry_sdk.init()?

If I put it in settings.py, I see no error messages being reported.

The docs say nothing about dajngo + new sentry-sdk, except the fact that raven one is deprecated!

Most helpful comment

Here is how you do it, for ref:

# settings.py 

import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration


sentry_sdk.init(
     "<sentry-dsn>", release="<version-info>", integrations=[DjangoIntegration()]
)

All 11 comments

Hi, you can find the docs for Django using sentry-sdk here: https://docs.sentry.io/platforms/python/django/?platform=python

(We're aware of the structural deficiencies of the new doc system. The intent was that you would have discovered it in "Getting started" using this alert:)

screen shot 2018-09-25 at 22 28 08

Ah thanks! That was weirdly hard to find!

I used the search tool, and this didn't come up..

Wow! this thing JUST WORKS. Hope everyone can find this easily.

Thanks for making this work so well.

That's heartwarming to hear :)

Have you had experience with the previous raven SDK or are you new to Sentry?

Yes. I was using raven earlier.

Not only did I find 3 different configs at 3 different places (the django LOGGING dict) to do the logging, but I was also presented with a load of debugging logs in my ssh console, which was very disturbing.

This one just worked as I wanted it to.

Glad to hear that! That was definetly the intention, to clean that up.

Here is how you do it, for ref:

# settings.py 

import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration


sentry_sdk.init(
     "<sentry-dsn>", release="<version-info>", integrations=[DjangoIntegration()]
)

Should also add install instruction (with pip for sentry_sdk), most docs include this in setup instructions. Takes 30 seconds to find, but usually this is just included -> pip install sentry-sdk

The other integration pages already have this. Would be glad about a PR.

On Wed, Nov 28, 2018, 18:14 Coler <[email protected] wrote:

Should also add install instruction (with pip for sentry_sdk), most docs
include this in setup instructions. Takes 30 seconds to find, but usually
this is just included.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/getsentry/sentry-python/issues/83#issuecomment-442528270,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAzHxZVT3_ibV-WF4-uZuxMWvs3O823Mks5uzsR4gaJpZM4W5alf
.

Opened #183 so I don't forget

On Wed, Nov 28, 2018, 19:35 Markus Unterwaditzer <[email protected] wrote:

The other integration pages already have this. Would be glad about a PR.

On Wed, Nov 28, 2018, 18:14 Coler <[email protected] wrote:

Should also add install instruction (with pip for sentry_sdk), most docs
include this in setup instructions. Takes 30 seconds to find, but usually
this is just included.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/getsentry/sentry-python/issues/83#issuecomment-442528270,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAzHxZVT3_ibV-WF4-uZuxMWvs3O823Mks5uzsR4gaJpZM4W5alf
.

Was this page helpful?
0 / 5 - 0 ratings