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

Already on GitHub? Sign in to your account

Switch URL_PREFIX for SENTRY_URL_PREFIX #1

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Contributor

ghickman commented Apr 14, 2012

In the case where URL_PREFIX doesn't exist, use SENTRY_URL_PREFIX in
it's place since this should be defined in the user's local settings.

@ghickman ghickman Use SENTRY_URL_PREFIX instead of URL_PREFIX incase.
In the case where URL_PREFIX doesn't exist, use SENTRY_URL_PREFIX in
it's place since this should be defined in the user's local settings.
ea3653f
Owner

mattrobenolt commented Apr 14, 2012

In what case would URL_PREFIX not exist? I took that logic out of the actual email module. I haven't seen SENTRY_URL_PREFIX.

Contributor

ghickman commented Apr 14, 2012

URL_PREFIX is defined as an empty string here: https://github.com/dcramer/sentry/blob/3.8.2/sentry/conf/defaults.py#L41

However I found it was turning up as None a lot of the time. I never actually tracked down where this was getting changed as I knew the SENTRY_URL_PREFIX was set in my config. I figured that as it's part of the generated config file and mentioned in the docs (http://sentry.readthedocs.org/en/latest/quickstart/index.html#initializing-the-configuration) it was safe to rely on this.

Owner

mattrobenolt commented Apr 14, 2012

Fair enough. I'll look into it tomorrow and track down the best options. Thanks.

Owner

mattrobenolt commented Apr 14, 2012

All SENTRY_* variables are internally stripped of SENTRY_, see: https://github.com/dcramer/sentry/blob/master/sentry/conf/settings.py#L23-25

There shouldn't be an instance where SENTRY_URL_PREFIX exists without URL_PREFIX existing unless you've manually overwritten somewhere.

What are you doing in your code to not have a URL_PREFIX?

Contributor

ghickman commented Apr 14, 2012

This is only true if you're using sentry as app inside a django project.

When installed as a system application the runner specifies the server settings file which doesn't contain the conversion code.

I could change the code to try SENTRY_URL_PREFIX first then URL_PREFIX next?

Owner

mattrobenolt commented Apr 16, 2012

Do you mind sending me your project so I can reproduce? I don't feel comfortable changing this because no other plugin uses that convention. They all access URL_PREFIX directly. Maybe when using the runner, you're supposed to declare URL_PREFIX instead?

/cc @dcramer

Owner

mattrobenolt commented Apr 16, 2012

I feel like, if anything, this could be an oversight in how Sentry handles loading different configs. One is being passed through the parser which converts SENTRY_* and the other isn't.

dcramer commented Apr 16, 2012

Ya this is the same setting. You configure things using SENTRY_*, but they're not referenced that way internally.

Owner

mattrobenolt commented Apr 16, 2012

Thanks for the confirmation. :)

@ghickman If there is still an issue with Sentry, you should file a bug there.

dcramer commented Apr 16, 2012

Oh actually, the problem is this is importing Django settings, and it should be doing "from sentry.conf import settings"

@ghickman ghickman referenced this pull request in ghickman/sentry-groveio Apr 16, 2012

@ghickman ghickman Import settings from sentry instead of django
Fixes URL_PREFIX not existing on settings if SENTRY_URL_PREFIX has been
used in the settings.
Pointed out by @dcramer in #1
9d0d2fd
Owner

mattrobenolt commented Apr 16, 2012

Ahh. I see. Thanks. :)

@ghickman ghickman referenced this pull request in ghickman/sentry-groveio Apr 16, 2012

@ghickman ghickman Import settings from sentry instead of django
Fixes URL_PREFIX not existing on settings if SENTRY_URL_PREFIX has been
used in the settings.
Pointed out by @dcramer in #1
e346458

@ghickman ghickman referenced this pull request in ghickman/sentry-groveio Apr 16, 2012

@ghickman ghickman Import settings from sentry instead of django
Fixes URL_PREFIX not existing on settings if SENTRY_URL_PREFIX has been
used in the settings.
Pointed out by @dcramer in #1
4861cd5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment