From e5040fbf942e021444f629a371bc71c9d47d052f Mon Sep 17 00:00:00 2001
From: Danilo Bargen <gezuru@gmail.com>
Date: Tue, 30 Apr 2013 23:24:20 +0200
Subject: [PATCH] Catch ImproperlyConfigured exception in compat.py (fixes
 #803)

---
 rest_framework/compat.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/rest_framework/compat.py b/rest_framework/compat.py
index 067e90183..f8e4e7cab 100644
--- a/rest_framework/compat.py
+++ b/rest_framework/compat.py
@@ -6,6 +6,7 @@ versions of django/python, and compatibility wrappers around optional packages.
 from __future__ import unicode_literals
 
 import django
+from django.core.exceptions import ImproperlyConfigured
 
 # Try to import six from Django, fallback to included `six`.
 try:
@@ -473,7 +474,7 @@ except ImportError:
 try:
     import oauth_provider
     from oauth_provider.store import store as oauth_provider_store
-except ImportError:
+except (ImportError, ImproperlyConfigured):
     oauth_provider = None
     oauth_provider_store = None