aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/settings.py
diff options
context:
space:
mode:
authorMarc Tamlyn2013-01-07 12:52:20 +0000
committerMarc Tamlyn2013-01-07 12:52:20 +0000
commitc736b80290dfd650bee0fa3c530da65792dcde32 (patch)
tree3ec0f22fd897f9fcdacf7006d853fd1f86f41ef2 /rest_framework/settings.py
parent152e6d5c0af9c55aa9c276b8270aad700c43eae3 (diff)
downloaddjango-rest-framework-c736b80290dfd650bee0fa3c530da65792dcde32.tar.bz2
Be more informative when reporting import errors.
Diffstat (limited to 'rest_framework/settings.py')
-rw-r--r--rest_framework/settings.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/rest_framework/settings.py b/rest_framework/settings.py
index ee24a4ad..5c77c55c 100644
--- a/rest_framework/settings.py
+++ b/rest_framework/settings.py
@@ -115,8 +115,8 @@ def import_from_string(val, setting_name):
module_path, class_name = '.'.join(parts[:-1]), parts[-1]
module = importlib.import_module(module_path)
return getattr(module, class_name)
- except:
- msg = "Could not import '%s' for API setting '%s'" % (val, setting_name)
+ except ImportError as e:
+ msg = "Could not import '%s' for API setting '%s'. %s: %s." % (val, setting_name, e.__class__.__name__, e)
raise ImportError(msg)