#30329: ImproperlyConfigured exceptions should be raised immediately.
---------------------------------+------------------------------------
     Reporter:  Alasdair Nicol   |                    Owner:  (none)
         Type:  Bug              |                   Status:  new
    Component:  Error reporting  |                  Version:  master
     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
---------------------------------+------------------------------------

Old description:

> When an older version of sqlite is installed, the final line of the
> traceback is unrelated.
>
> {{{
>     raise LookupError(message)
> LookupError: No installed app with label 'admin'.
> }}}
>
> If you look further up the traceback, you can see what the problem is,
> but this can be tricky for newer users.
>
> {{{
>     raise ImproperlyConfigured('SQLite 3.8.3 or later is required (found
> %s).' % Database.sqlite_version)
> django.core.exceptions.ImproperlyConfigured: SQLite 3.8.3 or later is
> required (found 3.7.17).
> }}}
>
> I think that if we made the error message clearer it would be helpful for
> new users. Perhaps we could do this by checking the sqlite version in a
> system check, or maybe there's a better approach.
>
> Related Stack Overflow question:
> https://stackoverflow.com/questions/55512244/no-installed-app-with-label-
> admin-in-empty-django-2-2-project/
>

> See
> [https://github.com/django/django/blob/755673e1bca7edb6bee7a958f40d9ae54d85d44c/django/apps/registry.py#L131-L134
> django/apps/registry.py].

New description:

 When an older version of sqlite is installed, the final line of the
 traceback in runserver is unrelated.

 {{{
     raise LookupError(message)
 LookupError: No installed app with label 'admin'.
 }}}

 If you look further up the traceback, you can see what the problem is, but
 this can be tricky for newer users.

 {{{
     raise ImproperlyConfigured('SQLite 3.8.3 or later is required (found
 %s).' % Database.sqlite_version)
 django.core.exceptions.ImproperlyConfigured: SQLite 3.8.3 or later is
 required (found 3.7.17).
 }}}

 I think that if we made the error message clearer it would be helpful for
 new users. Perhaps we could do this by checking the sqlite version in a
 system check, or maybe there's a better approach.

 Related Stack Overflow question:
 https://stackoverflow.com/questions/55512244/no-installed-app-with-label-
 admin-in-empty-django-2-2-project/


 See
 
[https://github.com/django/django/blob/755673e1bca7edb6bee7a958f40d9ae54d85d44c/django/apps/registry.py#L131-L134
 django/apps/registry.py].

--

Comment (by Alasdair Nicol):

 I ran git bisect and I believe the behaviour changed in #27685 when the
 autoloader changed.

 Only `runserver` shows the `LookupError` last - `manage.py check`,
 `manage.py migrate` and so on all show
 `django.core.exceptions.ImproperlyConfigured`.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30329#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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.344565379bbe0f6a4e0e785969e29382%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to