diff options
| author | oliver <myungsekyo@gmail.com> | 2018-06-17 04:18:57 +0900 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-06-16 15:18:57 -0400 |
| commit | 78972af367a1da54aa7e539e4b1ffa2b56571e77 (patch) | |
| tree | 3ccb3a31efa9a4c711414adce508744df00f8663 /django | |
| parent | 998d7741951c68b194eb9fab02509024bf60949e (diff) | |
Fixed #29469 -- Added a helpful makemigrations error if app_label contains dots.
Diffstat (limited to 'django')
| -rw-r--r-- | django/core/management/commands/makemigrations.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/django/core/management/commands/makemigrations.py b/django/core/management/commands/makemigrations.py index 14461418c1..1a166c6f99 100644 --- a/django/core/management/commands/makemigrations.py +++ b/django/core/management/commands/makemigrations.py @@ -73,7 +73,15 @@ class Command(BaseCommand): bad_app_labels.add(app_label) if bad_app_labels: for app_label in bad_app_labels: - self.stderr.write("App '%s' could not be found. Is it in INSTALLED_APPS?" % app_label) + if '.' in app_label: + self.stderr.write( + "'%s' is not a valid app label. Did you mean '%s'?" % ( + app_label, + app_label.split('.')[-1], + ) + ) + else: + self.stderr.write("App '%s' could not be found. Is it in INSTALLED_APPS?" % app_label) sys.exit(2) # Load the current graph state. Pass in None for the connection so |
