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 22477,Remove contrib middleware from MIDDLEWARE_CLASSES global defaults,Mark Lavin,Mark Lavin,"The app-loading refactor has deprecated importing a model which is not in the installed apps #21680. This leads to some incompatible defaults in the global settings defaults. In the defaults {{{INSTALLED_APPS}}} is empty but {{{MIDDLEWARE_CLASSES}}} contains {{{'django.contrib.sessions.middleware.SessionMiddleware'}}} and {{{'django.contrib.auth.middleware.AuthenticationMiddleware'}}} which rely on the related apps being in the {{{INSTALLED_APPS}}}. Since most users create their initial settings via {{{startproject}}} this isn't an issue but it still makes for a poor default. It also implies a coupling or dependency between Django core and {{{contrib.auth}}} and {{{contrib.sessions}}} which doesn't actually exist. My recommendation would be to remove any contrib middleware from the {{{MIDDLEWARE_CLASSES}}} in the global settings but continue to set them in the {{{startproject}}} template which also sets an appropriate {{{INSTALLED_APPS}}} setting. Since this setting is created by default in {{{startproject}}} I don't think this raises any major backwards incompatibility issues.",Cleanup/optimization,closed,Core (Other),1.7-beta-2,Release blocker,fixed,,,Accepted,1,0,0,0,0,0