You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would it make sense to check on a list being used for MIDDLEWARE and INSTALLED_APPS?
Motivation
Django originally used tuples for INSTALLED_APPS and MIDDLEWARE_CLASSES.
That's why, when projects are migrated to newer Django versions, those will remain to be tuples (even when renamed to MIDDLEWARE, for example). While this does not pose any direct problem for iterating over those values, it can be a problem when code tries to manipulate those objects. They should really be lists in modern Django code, consistently.
Would it make sense to check on a list being used for
MIDDLEWARE
andINSTALLED_APPS
?Motivation
Django originally used tuples for
INSTALLED_APPS
andMIDDLEWARE_CLASSES
.That's why, when projects are migrated to newer Django versions, those will remain to be tuples (even when renamed to
MIDDLEWARE
, for example). While this does not pose any direct problem for iterating over those values, it can be a problem when code tries to manipulate those objects. They should really be lists in modern Django code, consistently.Real-world Examples
The text was updated successfully, but these errors were encountered: