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

Catch ImproperlyConfigured exception for Django imports #28

Merged
merged 1 commit into from
Jul 9, 2014
Merged

Catch ImproperlyConfigured exception for Django imports #28

merged 1 commit into from
Jul 9, 2014

Conversation

homm
Copy link
Contributor

@homm homm commented Jun 27, 2014

When I try to import rollbar in environment with installed rest_framework, I get an error:

django.core.exceptions.ImproperlyConfigured: Requested setting DATABASES, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

This is because rest_framework imports django.db.models. I fix it by catching ImproperlyConfigured in addition to ImportError.

I also catch ImproperlyConfigured for django.http.HttpRequest, but this is optional.

@sbezboro sbezboro merged commit 5dd091b into rollbar:master Jul 9, 2014
@sbezboro
Copy link
Contributor

sbezboro commented Jul 9, 2014

Thanks for the PR @homm! Looks good to me. Merged and pushed to PyPi as version 0.8.2

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

Successfully merging this pull request may close these issues.

None yet

2 participants