diff --git a/django/contrib/admin/checks.py b/django/contrib/admin/checks.py index 5e4b785c33..a18ba22b46 100644 --- a/django/contrib/admin/checks.py +++ b/django/contrib/admin/checks.py @@ -132,6 +132,12 @@ def check_dependencies(**kwargs): errors.append(checks.Error( "'django.contrib.sessions.middleware.SessionMiddleware' must " "be in MIDDLEWARE in order to use the admin application.", + hint=( + "Insert " + "'django.contrib.sessions.middleware.SessionMiddleware' " + "before " + "'django.contrib.auth.middleware.AuthenticationMiddleware'." + ), id='admin.E410', )) return errors diff --git a/tests/admin_checks/tests.py b/tests/admin_checks/tests.py index 52f2188c9f..5744dc1b39 100644 --- a/tests/admin_checks/tests.py +++ b/tests/admin_checks/tests.py @@ -214,6 +214,12 @@ class SystemChecksTestCase(SimpleTestCase): checks.Error( "'django.contrib.sessions.middleware.SessionMiddleware' " "must be in MIDDLEWARE in order to use the admin application.", + hint=( + "Insert " + "'django.contrib.sessions.middleware.SessionMiddleware' " + "before " + "'django.contrib.auth.middleware.AuthenticationMiddleware'." + ), id='admin.E410', ), ]