AttributeError at /social-auth/complete/google-oauth2/ 'Request' object has no attribute 'login'

enter image description here

I had written a REST API service on python using django rest framework to which I wanted to attach authentication from authorizations using OAuth2 (Google). I used to social django lib, however when I was starting my service locally and putting my credentials in google form to auth I keep getting this error (look at image)...

The point where the error began auth = request.login in /messenger/venv/lib/python3.8/site-packages/requests/sessions.py, line 479, in prepare_request. It was weird, but I solved my problem!

I reinstalled the entire virtual environment, as well as all the places in the settings.py file that were responsible for auth. It helped me. Also you can check URLs and Redirect URLs on console.cloud.google.com where you have registered your web app.

Back to Top