This app makes it extremely easy to build Django powered SPA's (Single Page App) or Mobile apps exposing all registration and authentication related functionality as CBV's (Class Base View) and REST (JSON)
Hi, I'm not sure this should actually get merged as I think there should be a better solution to support this, but I managed to get django-axes working with django-rest-auth in the demo project this way (so this way is compatible with latest version of django-rest-auth.
A better solution would be to check for django-axes and see if it's installed, then implement the logic I added in serializers.py into the django-rest-auth library instead of the demo.
I also added a few tests while doing it. So most changes are in demo folder. The only exception is an update in docs folder if this ever get merged. It's safe to merge this, the fix in the library would need to clean the demo project.
[x] Updated all requirements
[x] Rename requirements.pip to requirements.txt (and updated docs for this)
[x] Add a RestAuthAxesLoginSerializer that will write the right message if axes_locked_out is set and True
[x] Add docker support for demo project (with updated documentation)
[x] Configure django-axes in settings
[x] Tests that covers serializers.py at 💯
Without the serializers.py changes, the django-axes works, but the error is not sent back in non_field_errors so if a user is locked out, he still gets the 'Unable to log in with provided credentials.' message.
Coverage remained the same at 96.044% when pulling b3d07028ca5ac4d798b2c0415eea044e7d7c9b2c on GabLeRoux:django-axes-demo into 624ad01afbc86fa15b4e652406f3bdcd01f36e00 on Tivix:master.
Coverage remained the same at 96.044% when pulling b3d07028ca5ac4d798b2c0415eea044e7d7c9b2c on GabLeRoux:django-axes-demo into 624ad01afbc86fa15b4e652406f3bdcd01f36e00 on Tivix:master.
Hi, I'm not sure this should actually get merged as I think there should be a better solution to support this, but I managed to get django-axes working with django-rest-auth in the demo project this way (so this way is compatible with latest version of django-rest-auth.
A better solution would be to check for django-axes and see if it's installed, then implement the logic I added in
serializers.py
into thedjango-rest-auth
library instead of the demo.I also added a few tests while doing it. So most changes are in
demo
folder. The only exception is an update indocs
folder if this ever get merged. It's safe to merge this, the fix in the library would need to clean the demo project.requirements.pip
torequirements.txt
(and updated docs for this)RestAuthAxesLoginSerializer
that will write the right message ifaxes_locked_out
is set and Trueserializers.py
at 💯Without the
serializers.py
changes, thedjango-axes
works, but the error is not sent back innon_field_errors
so if a user is locked out, he still gets the'Unable to log in with provided credentials.'
message.This relates to #477