diff options
Diffstat (limited to 'django/apps/config.py')
-rw-r--r-- | django/apps/config.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/django/apps/config.py b/django/apps/config.py index edd7a48a6f..88e52c1f05 100644 --- a/django/apps/config.py +++ b/django/apps/config.py @@ -139,7 +139,14 @@ class AppConfig(object): "'%s' must supply a name attribute." % entry) # Ensure app_name points to a valid module. - app_module = import_module(app_name) + try: + app_module = import_module(app_name) + except ImportError: + raise ImproperlyConfigured( + "Cannot import '%s'. Check that '%s.%s.name' is correct." % ( + app_name, mod_path, cls_name, + ) + ) # Entry is a path to an app config class. return cls(app_name, app_module) |