Repository: jazzband/django-axes

Issue:
ModuleNotFoundError: No module named 'ipware.ip2'  -- error in django-axes==5.0.7, Django==2.2, Python==3.8
`django-ipware` has no module `ipware.ip2` in recent version. Please fix this ASAP.

In the `helpers.py` file import `ipware.ip2` is breaking for new version of django-ipware.

```
django_1         | Traceback (most recent call last):
django_1         |   File "manage.py", line 30, in <module>
django_1         |     execute_from_command_line(sys.argv)
django_1         |   File "/usr/local/lib/python3.7/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
django_1         |     utility.execute()
django_1         |   File "/usr/local/lib/python3.7/site-packages/django/core/management/__init__.py", line 357, in execute
django_1         |     django.setup()
django_1         |   File "/usr/local/lib/python3.7/site-packages/django/__init__.py", line 24, in setup
django_1         |     apps.populate(settings.INSTALLED_APPS)
django_1         |   File "/usr/local/lib/python3.7/site-packages/django/apps/registry.py", line 122, in populate
django_1         |     app_config.ready()
django_1         |   File "/usr/local/lib/python3.7/site-packages/axes/apps.py", line 47, in ready
django_1         |     from axes import checks, signals  # noqa
django_1         |   File "/usr/local/lib/python3.7/site-packages/axes/signals.py", line 11, in <module>
django_1         |     from axes.handlers.proxy import AxesProxyHandler
django_1         |   File "/usr/local/lib/python3.7/site-packages/axes/handlers/proxy.py", line 7, in <module>
django_1         |     from axes.handlers.base import AxesHandler
django_1         |   File "/usr/local/lib/python3.7/site-packages/axes/handlers/base.py", line 2, in <module>
django_1         |     from axes.helpers import (
django_1         |   File "/usr/local/lib/python3.7/site-packages/axes/helpers.py", line 11, in <module>
django_1         |     import ipware.ip2
django_1         | ModuleNotFoundError: No module named 'ipware.ip2'

```



Discussion:
Same in here

404... https://github.com/un33k/django-ipware/blob/master/ipware/ip2.py

I hope you can fix this soon guys... our prod envs can not be deployed.. :(

Same here, please update django-ipware dependency
I confirm the issue. Quickfix: change ipware.ip2 to ipware.ip in the helpers file (twice in the file).

Resolving patch:
diff --git a/axes/helpers.py b/axes/helpers.py
--- a/axes/helpers.py
+++ b/axes/helpers.py
@@ -15,7 +15,7 @@
 from django.shortcuts import render
 from django.utils.module_loading import import_string
 
-import ipware.ip2
+import ipware.ip
 
 from axes.conf import settings
 from axes.models import AccessBase
@@ -156,7 +156,7 @@ def get_client_ip_address(request) -> str:
     and parameters can be configured in the Axes package.
     """
 
-    client_ip_address, _ = ipware.ip2.get_client_ip(
+    client_ip_address, _ = ipware.ip.get_client_ip(
         request,
         proxy_order=settings.AXES_PROXY_ORDER,
         proxy_count=settings.AXES_PROXY_COUNT,
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -36,7 +36,7 @@
     use_scm_version=True,
     setup_requires=["setuptools_scm"],
     python_requires="~=3.6",
-    install_requires=["django>=2.0", "django-appconf>=1.0.3", "django-ipware>=2.0.2,<3"],
+    install_requires=["django>=2.0", "django-appconf>=1.0.3", "django-ipware>=3,<4"],
     include_package_data=True,
     packages=find_packages(),
     classifiers=[


Test patch: