[Django] #29469: Makemigrations provides misleading error message.

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

[Django] #29469: Makemigrations provides misleading error message.

Django
#29469: Makemigrations provides misleading error message.
---------------------------------------------+------------------------
               Reporter:  Matthew Schinckel  |          Owner:  nobody
                   Type:  Uncategorized      |         Status:  new
              Component:  Uncategorized      |        Version:  2.0
               Severity:  Normal             |       Keywords:
           Triage Stage:  Unreviewed         |      Has patch:  0
    Needs documentation:  0                  |    Needs tests:  0
Patch needs improvement:  0                  |  Easy pickings:  0
                  UI/UX:  0                  |
---------------------------------------------+------------------------
 I have a couple of nested apps, or apps that are not available directly in
 the top-level namespace.

 When you use makemigrations, and pass the full dotted path to this
 command, the error message is somewhat misleading:


 {{{
 App 'integrations.systems.generic.importers' could not be found. Is it in
 INSTALLED_APPS?
 }}}

 In this case, I have that exact string in my INSTALLED_APPS, but
 makemigrations is expecting just the app_label. Perhaps we could improve
 the error message when dots are detected in the app_label, suggesting how
 to fix it: or even look at just the last part of the path?

--
Ticket URL: <https://code.djangoproject.com/ticket/29469>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/052.61ca690539772ff411730ac22aa1d586%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29469: Makemigrations provides misleading error message.

Django
#29469: Makemigrations provides misleading error message.
-----------------------------------+--------------------------------------
     Reporter:  Matthew Schinckel  |                    Owner:  nobody
         Type:  Uncategorized      |                   Status:  new
    Component:  Migrations         |                  Version:  2.0
     Severity:  Normal             |               Resolution:
     Keywords:                     |             Triage Stage:  Unreviewed
    Has patch:  0                  |      Needs documentation:  0
  Needs tests:  0                  |  Patch needs improvement:  0
Easy pickings:  0                  |                    UI/UX:  0
-----------------------------------+--------------------------------------
Changes (by Matthew Schinckel):

 * component:  Uncategorized => Migrations


--
Ticket URL: <https://code.djangoproject.com/ticket/29469#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/067.7f1faa0b1d7405fdf2fd6ce5b8d50a42%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29469: Makemigrations provides misleading error message.

Django
In reply to this post by Django
#29469: Makemigrations provides misleading error message.
-----------------------------------+--------------------------------------
     Reporter:  Matthew Schinckel  |                    Owner:  nobody
         Type:  Uncategorized      |                   Status:  new
    Component:  Migrations         |                  Version:  2.0
     Severity:  Normal             |               Resolution:
     Keywords:                     |             Triage Stage:  Unreviewed
    Has patch:  0                  |      Needs documentation:  0
  Needs tests:  0                  |  Patch needs improvement:  0
Easy pickings:  0                  |                    UI/UX:  0
-----------------------------------+--------------------------------------

Comment (by Windson yang):

 Maybe you should add an example project?

--
Ticket URL: <https://code.djangoproject.com/ticket/29469#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/067.48ae7f3b7c408d849dc884016efb63fd%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29469: Misleading makemigrations "App count not be found" error message with nested apps (was: Makemigrations provides misleading error message.)

Django
In reply to this post by Django
#29469: Misleading makemigrations "App count not be found" error message with
nested apps
-----------------------------------+------------------------------------
     Reporter:  Matthew Schinckel  |                    Owner:  nobody
         Type:  Bug                |                   Status:  new
    Component:  Migrations         |                  Version:  2.0
     Severity:  Normal             |               Resolution:
     Keywords:                     |             Triage Stage:  Accepted
    Has patch:  0                  |      Needs documentation:  0
  Needs tests:  0                  |  Patch needs improvement:  0
Easy pickings:  0                  |                    UI/UX:  0
-----------------------------------+------------------------------------
Changes (by Tim Graham):

 * type:  Uncategorized => Bug
 * stage:  Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/29469#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/067.7d8bdac8ef935042b8497243c78c7134%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29469: Misleading makemigrations "App count not be found" error message with nested apps

Django
In reply to this post by Django
#29469: Misleading makemigrations "App count not be found" error message with
nested apps
-----------------------------------+------------------------------------
     Reporter:  Matthew Schinckel  |                    Owner:  oliver
         Type:  Bug                |                   Status:  assigned
    Component:  Migrations         |                  Version:  2.0
     Severity:  Normal             |               Resolution:
     Keywords:                     |             Triage Stage:  Accepted
    Has patch:  0                  |      Needs documentation:  0
  Needs tests:  0                  |  Patch needs improvement:  0
Easy pickings:  0                  |                    UI/UX:  0
-----------------------------------+------------------------------------
Changes (by oliver):

 * owner:  nobody => oliver
 * status:  new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/29469#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/067.4d66fa5dae8291df59983b43943f22a4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29469: Misleading makemigrations "App count not be found" error message with nested apps

Django
In reply to this post by Django
#29469: Misleading makemigrations "App count not be found" error message with
nested apps
-----------------------------------+------------------------------------
     Reporter:  Matthew Schinckel  |                    Owner:  (none)
         Type:  Bug                |                   Status:  new
    Component:  Migrations         |                  Version:  2.0
     Severity:  Normal             |               Resolution:
     Keywords:                     |             Triage Stage:  Accepted
    Has patch:  0                  |      Needs documentation:  0
  Needs tests:  0                  |  Patch needs improvement:  0
Easy pickings:  0                  |                    UI/UX:  0
-----------------------------------+------------------------------------
Changes (by oliver):

 * owner:  oliver => (none)
 * status:  assigned => new


--
Ticket URL: <https://code.djangoproject.com/ticket/29469#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/067.73c35bfeefb315fffd0248968a6e5f25%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29469: Misleading makemigrations "App count not be found" error message with nested apps

Django
In reply to this post by Django
#29469: Misleading makemigrations "App count not be found" error message with
nested apps
-----------------------------------+------------------------------------
     Reporter:  Matthew Schinckel  |                    Owner:  oliver
         Type:  Bug                |                   Status:  assigned
    Component:  Migrations         |                  Version:  2.0
     Severity:  Normal             |               Resolution:
     Keywords:                     |             Triage Stage:  Accepted
    Has patch:  0                  |      Needs documentation:  0
  Needs tests:  0                  |  Patch needs improvement:  0
Easy pickings:  0                  |                    UI/UX:  0
-----------------------------------+------------------------------------
Changes (by oliver):

 * status:  new => assigned
 * owner:  (none) => oliver


--
Ticket URL: <https://code.djangoproject.com/ticket/29469#comment:6>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/067.1746ef453abb78e09ef07810f32c646a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29469: Misleading makemigrations "App count not be found" error message with nested apps

Django
In reply to this post by Django
#29469: Misleading makemigrations "App count not be found" error message with
nested apps
-----------------------------------+------------------------------------
     Reporter:  Matthew Schinckel  |                    Owner:  oliver
         Type:  Bug                |                   Status:  assigned
    Component:  Migrations         |                  Version:  2.0
     Severity:  Normal             |               Resolution:
     Keywords:                     |             Triage Stage:  Accepted
    Has patch:  0                  |      Needs documentation:  0
  Needs tests:  0                  |  Patch needs improvement:  0
Easy pickings:  0                  |                    UI/UX:  0
-----------------------------------+------------------------------------

Comment (by oliver):

 Current code generating that error message is as follows when using
 makemigraions command.
 {{{
        # Make sure the app they asked for exists
         app_labels = set(app_labels)
         bad_app_labels = set()
         for app_label in app_labels:
             try:
                 apps.get_app_config(app_label)
             except LookupError:
                 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)
             sys.exit(2)
 }}}

 and below is the part that checks the validity of the app name when using
 startapp and createproject command

 {{{
         if not name.isidentifier():
             raise CommandError(
                 "'{name}' is not a valid {app} name. Please make sure the
 "
                 "name is a valid identifier.".format(
                     name=name,
                     app=app_or_project,
                 )
             )
 }}}


 How about using the code validating app name to current code as follows?
 https://github.com/django/django/pull/10051

 {{{
        # Make sure the app they asked for is a valid app name and exist.
         app_labels = set(app_labels)
         bad_app_labels = set()
         for app_label in app_labels:
             try:
                 apps.get_app_config(app_label)
             except LookupError:
                 bad_app_labels.add(app_label)
         if bad_app_labels:
             for app_label in bad_app_labels:
                 if not app_label.isidentifier():
                     self.stderr.write(
                         "'%s' is not a valid app name. Please make sure
 the "
                         "name is a valid identifire."% app_label
                     )
                 else:
                     self.stderr.write("App '%s' could not be found. Is it
 in INSTALLED_APPS?" % app_label)
             sys.exit(2)
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/29469#comment:7>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/067.0016e552314b7d9ae86f84f48e57334b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29469: Misleading makemigrations "App count not be found" error message with nested apps

Django
In reply to this post by Django
#29469: Misleading makemigrations "App count not be found" error message with
nested apps
-----------------------------------+------------------------------------
     Reporter:  Matthew Schinckel  |                    Owner:  oliver
         Type:  Bug                |                   Status:  assigned
    Component:  Migrations         |                  Version:  2.0
     Severity:  Normal             |               Resolution:
     Keywords:                     |             Triage Stage:  Accepted
    Has patch:  1                  |      Needs documentation:  0
  Needs tests:  1                  |  Patch needs improvement:  0
Easy pickings:  0                  |                    UI/UX:  0
-----------------------------------+------------------------------------
Changes (by Tim Graham):

 * has_patch:  0 => 1
 * needs_tests:  0 => 1


Comment:

 [https://github.com/django/django/pull/10052 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/29469#comment:8>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/067.a442f36527770334a84193b65aee2cfa%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29469: Misleading makemigrations "App count not be found" error message with nested apps

Django
In reply to this post by Django
#29469: Misleading makemigrations "App count not be found" error message with
nested apps
-----------------------------------+------------------------------------
     Reporter:  Matthew Schinckel  |                    Owner:  oliver
         Type:  Bug                |                   Status:  assigned
    Component:  Migrations         |                  Version:  2.0
     Severity:  Normal             |               Resolution:
     Keywords:                     |             Triage Stage:  Accepted
    Has patch:  1                  |      Needs documentation:  0
  Needs tests:  1                  |  Patch needs improvement:  0
Easy pickings:  0                  |                    UI/UX:  0
-----------------------------------+------------------------------------

Comment (by oliver):

 https://github.com/django/django/pull/10057

 I change the target branch to master and add a test.

--
Ticket URL: <https://code.djangoproject.com/ticket/29469#comment:9>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/067.ca597e1478813fbf0dbc060b4b4c5ae6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29469: Misleading makemigrations "App count not be found" error message with nested apps

Django
In reply to this post by Django
#29469: Misleading makemigrations "App count not be found" error message with
nested apps
-----------------------------------+------------------------------------
     Reporter:  Matthew Schinckel  |                    Owner:  oliver
         Type:  Bug                |                   Status:  closed
    Component:  Migrations         |                  Version:  2.0
     Severity:  Normal             |               Resolution:  fixed
     Keywords:                     |             Triage Stage:  Accepted
    Has patch:  1                  |      Needs documentation:  0
  Needs tests:  1                  |  Patch needs improvement:  0
Easy pickings:  0                  |                    UI/UX:  0
-----------------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"78972af367a1da54aa7e539e4b1ffa2b56571e77" 78972af3]:
 {{{
 #!CommitTicketReference repository=""
 revision="78972af367a1da54aa7e539e4b1ffa2b56571e77"
 Fixed #29469 -- Added a helpful makemigrations error if app_label contains
 dots.
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/29469#comment:10>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/067.1515a2bfefd573cadae3971d9a53ae6d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29469: Misleading makemigrations "App count not be found" error message with nested apps

Django
In reply to this post by Django
#29469: Misleading makemigrations "App count not be found" error message with
nested apps
-----------------------------------+------------------------------------
     Reporter:  Matthew Schinckel  |                    Owner:  oliver
         Type:  Bug                |                   Status:  closed
    Component:  Migrations         |                  Version:  2.0
     Severity:  Normal             |               Resolution:  fixed
     Keywords:                     |             Triage Stage:  Accepted
    Has patch:  1                  |      Needs documentation:  0
  Needs tests:  1                  |  Patch needs improvement:  0
Easy pickings:  0                  |                    UI/UX:  0
-----------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

 In [changeset:"d03b130cbcc629daa5ae767588b2fff41ea1e48a" d03b130c]:
 {{{
 #!CommitTicketReference repository=""
 revision="d03b130cbcc629daa5ae767588b2fff41ea1e48a"
 [2.1.x] Fixed #29469 -- Added a helpful makemigrations error if app_label
 contains dots.

 Backport of 78972af367a1da54aa7e539e4b1ffa2b56571e77 from master
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/29469#comment:11>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/067.a4b91728ea9f4173c86672be0615344b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29469: Misleading makemigrations "App count not be found" error message with nested apps

Django
In reply to this post by Django
#29469: Misleading makemigrations "App count not be found" error message with
nested apps
-----------------------------------+------------------------------------
     Reporter:  Matthew Schinckel  |                    Owner:  oliver
         Type:  Bug                |                   Status:  closed
    Component:  Migrations         |                  Version:  2.0
     Severity:  Normal             |               Resolution:  fixed
     Keywords:                     |             Triage Stage:  Accepted
    Has patch:  1                  |      Needs documentation:  0
  Needs tests:  1                  |  Patch needs improvement:  0
Easy pickings:  0                  |                    UI/UX:  0
-----------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

 In [changeset:"c3c7d15c34d6174ff25a49d7c9a57da140769567" c3c7d15]:
 {{{
 #!CommitTicketReference repository=""
 revision="c3c7d15c34d6174ff25a49d7c9a57da140769567"
 Refs #29469 -- Reused get_app_config() error message in makemigrations
 error.
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/29469#comment:12>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/067.521e19e9103b3103a482790275a6d7be%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.