Django log user IP for user_login_failed signal
Unfortunately user_login_failed
singal don't pass request as argument.
Checkout django-axes
— https://github.com/django-pci/django-axes/
It uses a custom view decorator to track failed logins.
https://github.com/django-pci/django-axes/blob/master/axes/decorators.py#L273
I just found in newer Django version (I am using 2.1) has updated this and now it includes the request object in the user_login_failed signal:
https://docs.djangoproject.com/en/2.1/ref/contrib/auth/#django.contrib.auth.signals.user_login_failed