﻿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
33362	ALLOWED_HOSTS no longer accepts a non-list/tuple iterable.	Carlton Gibson	nobody	"cdd0b213a825fcfe90ae93dcc554fba8c1e5ff5d added `ALLOWED_HOSTS` to the list of `tuple_settings` that are checked to be lists or tuples in `Settings.__init__()`. 

This causes a regression with settings such as: 


{{{
class AllowedHosts:
    """"""
    An allowed hosts proxy, implementing SOME logic to determine ALLOWED_HOSTS.
    """"""

    DEBUG_ALLOWED_HOSTS = [""localhost"", ""127.0.0.1"", ""[::1]""]

    def __iter__(self):
        if settings.DEBUG:
            yield from self.DEBUG_ALLOWED_HOSTS

        yield ""domain.com""
        yield ""domain.org""
        yield from [
            ""other-domain.com"",
            ""www.other-domain.com"",                                                                                         
        ]
        
ALLOWED_HOSTS = AllowedHosts()
}}}

This works fine before Django 4.0 but raises afterwards:


{{{
raise ImproperlyConfigured(""The %s setting must be a list or a tuple."" % setting)
django.core.exceptions.ImproperlyConfigured: The ALLOWED_HOSTS setting must be a list or a tuple.
}}}

We could revert cdd0b213a825fcfe90ae93dcc554fba8c1e5ff5d, or else adjust the test. I think the force of it is ""`iterable()` but not a string""? 🤔"	Bug	closed	HTTP handling	4.0	Normal	invalid			Unreviewed	0	0	0	0	0	0
