﻿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
35609	RemovedInDjango50Warning communications with changing the default USE_TZ	Vladislav Dobrovolskiy		"Good afternoon
When starting Django, we found a Warning that cannot be corrected (it continues to be displayed in the logs and terminal). This happens because the settings are initialized more than once and the condition for displaying the warning is incorrect, in my opinion. Example from code:


{{{
        self._explicit_settings = set()
        for setting in dir(mod):
            if setting.isupper():
                setting_value = getattr(mod, setting)

                if setting in tuple_settings and not isinstance(
                    setting_value, (list, tuple)
                ):
                    raise ImproperlyConfigured(
                        ""The %s setting must be a list or a tuple."" % setting
                    )
                setattr(self, setting, setting_value)
                self._explicit_settings.add(setting)

        if self.USE_TZ is False and not self.is_overridden(""USE_TZ""):
            warnings.warn(
                ""The default value of USE_TZ will change from False to True ""
                ""in Django 5.0. Set USE_TZ to False in your project settings ""
                ""if you want to keep the current default behavior."",
                category=RemovedInDjango50Warning,
            )
}}}

When first initialized, **dir(mod)** contains

{{{
['__annotations__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__']
}}}

During the second initialization, the project settings are already. This doesn't affect how django works, but it can be confusing. It might be worth replacing the warning condition:

{{{
        def is_overridden(self, setting):
            return setting in self._explicit_settings and self._explicit_settings
}}}

Because the multitude **self._explicit_settings** may be empty due to a condition **if setting.isupper():**
"	Cleanup/optimization	closed	Core (System checks)	4.2	Normal	invalid			Unreviewed	0	0	0	0	0	0
