﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
32894	isinstance() checks with non-configured LazySettings raise an exception.	simon klemenc	nobody	"steps to reproduce:


{{{
import django.conf

settings = django.conf.LazySettings()
isinstance(settings, dict)

---------------------------------------------------------------------------
ImproperlyConfigured                      Traceback (most recent call last)
<ipython-input-36-201b302c2983> in <module>
      2 
      3 settings = django.conf.LazySettings()
----> 4 isinstance(settings, str)

~/.local/lib/python3.9/site-packages/django/utils/functional.py in inner(self, *args)
    244     def inner(self, *args):
    245         if self._wrapped is empty:
--> 246             self._setup()
    247         return func(self._wrapped, *args)
    248     return inner

~/.local/lib/python3.9/site-packages/django/conf/__init__.py in _setup(self, name)
     61         if not settings_module:
     62             desc = (""setting %s"" % name) if name else ""settings""
---> 63             raise ImproperlyConfigured(
     64                 ""Requested %s, but settings are not configured. ""
     65                 ""You must either define the environment variable %s ""

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.
}}}

isinstance is accessing __class__ which wants to setup the lazyobject
maybe __class__ should fall back to returning the ""LazyObject"""	Cleanup/optimization	closed	Utilities	3.2	Normal	needsinfo	lazyobject lazysettings	Keryn Knight	Unreviewed	0	0	0	0	1	0
