Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django Template Tag {% sentry_public_dsn %} missing #88

Closed
SteinRobert opened this issue Sep 27, 2018 · 2 comments
Closed

Django Template Tag {% sentry_public_dsn %} missing #88

SteinRobert opened this issue Sep 27, 2018 · 2 comments
Labels
Enhancement New feature or request

Comments

@SteinRobert
Copy link

While moving a project from raven-python to sentry-python I noticed, that there is no documentation (and maybe implementation?) for the template tag {% sentry_public_dsn %}.
It was available in raven-python - I found it to be quiet handy.
I hope I am not missing something - or is there a reason that this wasn't implemented?

@untitaker
Copy link
Member

No particular reason except prioritization of features (this is one of the features that is just easy enough to implement yourself, which is why we've deprioritized it).

Also I personally am unsure if that template tag should just magically become available if somebody runs sentry_sdk.init

@untitaker untitaker added the Enhancement New feature or request label Sep 27, 2018
@mitsuhiko
Copy link
Member

@SteinRobert we will no longer add this tag because it's no longer needed. The SDK now accepts a public DSN now so if you do want to use the same DSN you can pass it to the template in the render page by passing the DSN from the client options or something to that effect:

from sentry_sdk import last_event_id, Hub
from django.shortcuts import render

def handler500(request, *args, **argv):
    dsn = Hub.current.client.options.dsn
    return render(request, "500.html", {
        'sentry_event_id': last_event_id(),
        'dsn': Hub.current.client.options['dsn'],
    }, status=500)

Secondly that tag encouraged users to configure the frontend javascript with the backend dsn as it was available even on non user feedback pages and that is a pattern we do not want users to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants