rollbar/pyrollbar — pull request #28 by homm (2014-06-27 12:28:01+00:00)
Title: Catch ImproperlyConfigured exception for Django imports

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.