#29236: diffsettings raises misleading exception message if using
settings.configure
-------------------------------------+-------------------------------------
               Reporter:  Keryn      |          Owner:  nobody
  Knight                             |
                   Type:  Bug        |         Status:  new
              Component:  Core       |        Version:  master
  (Management commands)              |
               Severity:  Normal     |       Keywords:
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  1
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 If, rather than using the env var `DJANGO_SETTINGS_MODULE` one uses
 `settings.configure(...)`, attempting to call diffsettings can fail
 because it calls `settings._setup()` unconditionally, with the exception
 {{{
 django.core.exceptions.ImproperlyConfigured: Requested settings, but
 settings are not configured. You must either define the environment
 variable DJANGO_SETTINGS_MODULE or call settings.configure() before
 accessing settings.
 }}}
 were the call instead:
 {{{
 if not settings.configured:
     settings._setup()
 }}}
 things would work correctly.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29236>
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/052.d76b94f8f3fe6e896429a63ffca43c49%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to