Error in adding django-axes to project

I have installed django axes with this command in cmd :

pip install django-axes

Then i addes to my setting.py file this parts :

    INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'post_app',
    'axes',
]

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'axes.middleware.FailedLoginMiddleware',
]

AXES_LOCK_OUT_AT_FAILURE = False
AXES_USE_USER_AGENT = True
AXES_COOLOFF_TIME = 1
AXES_LOGIN_FAILURE_LIMIT = 50

Now i want to runserver with this command :

python manage.py runserver

But i have this error in cmd :

  Unhandled exception in thread started by <function wrapper at 0x0000000004AA4908>
Traceback (most recent call last):
  File "D:\python\data\lib\site-packages\django\utils\autoreload.py", line 228, in wrapper
    fn(*args, **kwargs)
  File "D:\python\data\lib\site-packages\django\core\management\commands\runserver.py", line 117, in inner_run
    autoreload.raise_last_exception()
  File "D:\python\data\lib\site-packages\django\utils\autoreload.py", line 251, in raise_last_exception
    six.reraise(*_exception)
  File "D:\python\data\lib\site-packages\django\utils\autoreload.py", line 228, in wrapper
    fn(*args, **kwargs)
  File "D:\python\data\lib\site-packages\django\__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "D:\python\data\lib\site-packages\django\apps\registry.py", line 116, in populate
    app_config.ready()
  File "D:\python\data\lib\site-packages\axes\apps.py", line 9, in ready
    from axes.decorators import watch_login
  File "D:\python\data\lib\site-packages\axes\decorators.py", line 3, in <module>
    from socket import inet_pton, AF_INET6, error
ImportError: cannot import name inet_pton

Is there any mistake?or any missed work?

1 answer