Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django Defender is not working on my userlogin view #159

Open
Hamza-Lachi opened this issue May 13, 2020 · 12 comments
Open

Django Defender is not working on my userlogin view #159

Hamza-Lachi opened this issue May 13, 2020 · 12 comments

Comments

@Hamza-Lachi
Copy link

Hamza-Lachi commented May 13, 2020

in my admin it's work correctly

in my user login view it's not working, it didn't show any access attempts and not blocking any IP and username

@kencochrane
Copy link
Collaborator

Are you using the built in django LoginView or do you have something custom for handling your logins?

@Hamza-Lachi
Copy link
Author

I had my own login function in my views

@kencochrane
Copy link
Collaborator

Ok, since you have a custom view you will need to wrap your view with the decorator, or add all the different logic into your login view manually.

Did you try that already?

@Hamza-Lachi
Copy link
Author

Sorry, I can't understand

@kencochrane
Copy link
Collaborator

Is it working now or do you still have an issue?

@Hamza-Lachi
Copy link
Author

I still have if I use Django built-in login system it works correctly but if I use my login function it doesn't work

@Hamza-Lachi
Copy link
Author

Hamza-Lachi commented May 24, 2020

any solution?

@kencochrane
Copy link
Collaborator

@Hamza-Lachi You will need to either add Django defender directly to our custom login function like it shows in the docs here: https://django-defender.readthedocs.io/en/latest/#adapting-to-other-authentication-methods

Or you can use the watch_login decorator directly on your login view in the URLs file like you see in the stack overflow answer. https://stackoverflow.com/a/5797020/356788

Hope that helps

@kencochrane
Copy link
Collaborator

@Hamza-Lachi can we close this issue?

@akas128
Copy link

akas128 commented Sep 22, 2021

how Django defender will help in OTP based login app?

@TTorture
Copy link

@kencochrane thank you! I ran in the same issue and your comment from May 27, 2020 resolved it for me. Would it make sense to mention this in the docs (unless it is already there and I have not seen it)?

@kencochrane
Copy link
Collaborator

@TTorture feel free to submit a PR to add it to the docs, it probably isn't there and if a few people are asking about it, there will probably be more in the future. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants