summaryrefslogtreecommitdiff
path: root/django/apps/registry.py
diff options
context:
space:
mode:
authorPeter Inglesby <peter.inglesby@gmail.com>2015-05-12 10:02:23 +0100
committerTim Graham <timograham@gmail.com>2015-05-22 11:08:25 -0400
commit0688a7946afac04123309afd29c95319a8d59392 (patch)
tree01c9b48d0d39d2538d288c34c5fa1baa91f00dd1 /django/apps/registry.py
parent70faaccc3eef916e1b1ba5c2e93799074e66a5c3 (diff)
Fixed #24776 -- Improved apps.get_app_config() error message on fully-qualified package names.
Diffstat (limited to 'django/apps/registry.py')
-rw-r--r--django/apps/registry.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/django/apps/registry.py b/django/apps/registry.py
index 96d4db5f17..0602c4ff57 100644
--- a/django/apps/registry.py
+++ b/django/apps/registry.py
@@ -147,7 +147,12 @@ class Apps(object):
try:
return self.app_configs[app_label]
except KeyError:
- raise LookupError("No installed app with label '%s'." % app_label)
+ message = "No installed app with label '%s'." % app_label
+ for app_config in self.get_app_configs():
+ if app_config.name == app_label:
+ message += " Did you mean '%s'?" % app_config.label
+ break
+ raise LookupError(message)
# This method is performance-critical at least for Django's test suite.
@lru_cache.lru_cache(maxsize=None)