Repository: jazzband/django-axes

Issue:
W003 error in 5.36.0 using AxesStandaloneBackend
Upon upgrading to the latest version, and switching to AxesStandaloneBackend under AUTHENTICATION_BACKENDS, I am getting the W003 error. I've silenced it for now using the info in the docs, but perhaps the config checker needs updating as well?


Discussion:
confirmed - I got the same warning, after following the instructions in the documentation.

Resolving patch:
diff --git a/axes/checks.py b/axes/checks.py
--- a/axes/checks.py
+++ b/axes/checks.py
@@ -5,7 +5,7 @@
 )
 from django.utils.module_loading import import_string
 
-from axes.backends import AxesBackend
+from axes.backends import AxesStandaloneBackend
 from axes.conf import settings
 
 
@@ -19,16 +19,14 @@ class Messages:
     MIDDLEWARE_INVALID = (
         "You do not have 'axes.middleware.AxesMiddleware' in your settings.MIDDLEWARE."
     )
-    BACKEND_INVALID = "You do not have 'axes.backends.AxesBackend' or a subclass in your settings.AUTHENTICATION_BACKENDS."
+    BACKEND_INVALID = "You do not have 'axes.backends.AxesStandaloneBackend' or a subclass in your settings.AUTHENTICATION_BACKENDS."
     SETTING_DEPRECATED = "You have a deprecated setting {deprecated_setting} configured in your project settings"
 
 
 class Hints:
     CACHE_INVALID = None
     MIDDLEWARE_INVALID = None
-    BACKEND_INVALID = (
-        "AxesModelBackend was renamed to AxesBackend in django-axes version 5.0."
-    )
+    BACKEND_INVALID = "AxesModelBackend was renamed to AxesStandaloneBackend in django-axes version 5.0."
     SETTING_DEPRECATED = None
 
 
@@ -101,7 +99,7 @@ def axes_backend_check(app_configs, **kwargs):  # pylint: disable=unused-argumen
                 "Can not import backend class defined in settings.AUTHENTICATION_BACKENDS"
             ) from e
 
-        if issubclass(backend, AxesBackend):
+        if issubclass(backend, AxesStandaloneBackend):
             found = True
             break
 


Test patch:
diff --git a/tests/settings.py b/tests/settings.py
--- a/tests/settings.py
+++ b/tests/settings.py
@@ -20,7 +20,7 @@
 ]
 
 AUTHENTICATION_BACKENDS = [
-    "axes.backends.AxesBackend",
+    "axes.backends.AxesStandaloneBackend",
     "django.contrib.auth.backends.ModelBackend",
 ]
 
diff --git a/tests/test_checks.py b/tests/test_checks.py
--- a/tests/test_checks.py
+++ b/tests/test_checks.py
@@ -1,7 +1,7 @@
 from django.core.checks import run_checks, Warning  # pylint: disable=redefined-builtin
 from django.test import override_settings, modify_settings
 
-from axes.backends import AxesBackend
+from axes.backends import AxesStandaloneBackend
 from axes.checks import Messages, Hints, Codes
 from tests.base import AxesTestCase
 
@@ -58,12 +58,14 @@ def test_cache_check_warnings(self):
         self.assertEqual(warnings, [warning])
 
 
-class AxesSpecializedBackend(AxesBackend):
+class AxesSpecializedBackend(AxesStandaloneBackend):
     pass
 
 
 class BackendCheckTestCase(AxesTestCase):
-    @modify_settings(AUTHENTICATION_BACKENDS={"remove": ["axes.backends.AxesBackend"]})
+    @modify_settings(
+        AUTHENTICATION_BACKENDS={"remove": ["axes.backends.AxesStandaloneBackend"]}
+    )
     def test_backend_missing(self):
         warnings = run_checks()
         warning = Warning(