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

Fail hard if relevant settings are not available #5

Open
mx-moth opened this issue Feb 26, 2016 · 2 comments
Open

Fail hard if relevant settings are not available #5

mx-moth opened this issue Feb 26, 2016 · 2 comments

Comments

@mx-moth
Copy link

mx-moth commented Feb 26, 2016

In the Readme, under TODO:

fail gracefully if the relevant settings aren't available

I suggest instead failing hard if the required settings are not available, by throwing an error as part of a Django app check. Missing settings are a configuration error that should be visible at the time of configuration. Failing softly later when a user browses to the analytics page leaves that user with no way of fixing it besides contacting the system administrator who forgot to add the settings in the first place.

@tomdyson
Copy link
Owner

Thanks, @timheap, you're right, of course!

@tomdyson
Copy link
Owner

note to self:

from django.conf import settings

if not hasattr(settings, 'GA_KEY_FILEPATH'):
   # error
if not hasattr(settings, 'GA_VIEW_ID'):
   # error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants