unhashable type when redirecting back to the website using python-social-auth in Django -


i'm trying add social media authentication website using social-auth-app-django.

so i've created different apps popular social media websites (facebook, twitter, google+), , have set callback url there.

but i'm coming across error when i'm redirected website facebook:

    internal server error: /oauth/complete/facebook/ traceback (most recent call last):   file "/usr/local/lib/python3.5/site-packages/django/core/handlers/exception.py", line 39, in inner     response = get_response(request)   file "/usr/local/lib/python3.5/site-packages/django/core/handlers/base.py", line 187, in _get_response     response = self.process_exception_by_middleware(e, request)   file "/usr/local/lib/python3.5/site-packages/django/core/handlers/base.py", line 185, in _get_response     response = wrapped_callback(request, *callback_args, **callback_kwargs)   file "/usr/local/lib/python3.5/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func     response = view_func(request, *args, **kwargs)   file "/usr/local/lib/python3.5/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view     return view_func(*args, **kwargs)   file "/usr/local/lib/python3.5/site-packages/social_django/utils.py", line 50, in wrapper     return func(request, backend, *args, **kwargs)   file "/usr/local/lib/python3.5/site-packages/social_django/views.py", line 32, in complete     redirect_name=redirect_field_name, *args, **kwargs)   file "/usr/local/lib/python3.5/site-packages/social_core/actions.py", line 41, in do_complete     user = backend.complete(user=user, *args, **kwargs)   file "/usr/local/lib/python3.5/site-packages/social_core/backends/base.py", line 40, in complete     return self.auth_complete(*args, **kwargs)   file "/usr/local/lib/python3.5/site-packages/social_core/utils.py", line 252, in wrapper     return func(*args, **kwargs)   file "/usr/local/lib/python3.5/site-packages/social_core/backends/facebook.py", line 110, in auth_complete     return self.do_auth(access_token, response, *args, **kwargs)   file "/usr/local/lib/python3.5/site-packages/social_core/backends/facebook.py", line 152, in do_auth     return self.strategy.authenticate(*args, **kwargs)   file "/usr/local/lib/python3.5/site-packages/social_django/strategy.py", line 115, in authenticate     return authenticate(*args, **kwargs)   file "/usr/local/lib/python3.5/site-packages/django/contrib/auth/__init__.py", line 74, in authenticate     user = backend.authenticate(**credentials)   file "/usr/local/lib/python3.5/site-packages/social_core/backends/base.py", line 80, in authenticate     return self.pipeline(pipeline, *args, **kwargs)   file "/usr/local/lib/python3.5/site-packages/social_core/backends/base.py", line 83, in pipeline     out = self.run_pipeline(pipeline, pipeline_index, *args, **kwargs)   file "/usr/local/lib/python3.5/site-packages/social_core/backends/base.py", line 105, in run_pipeline     idx, name in enumerate(pipeline[pipeline_index:]): typeerror: unhashable type: 'slice' 

below summary of how i've configured social_django:

in settings.py:

installed_apps = [     'social_django',     ... ]  authentication_backends = (     'social_core.backends.google.googleoauth2',     'social_core.backends.twitter.twitteroauth',     'social_core.backends.facebook.facebookoauth2',      'django.contrib.auth.backends.modelbackend', )  social_auth_facebook_key = 'xxx' social_auth_facebook_secret = 'xxx'  ...  pipeline = {     'pipeline_enabled': true,     'stylesheets': {...},     'javascript': {...},     'js_compressor': 'pipeline.compressors.noopcompressor',     'compilers': (         'pipeline.compilers.sass.sasscompiler',     ) } 

afterwards, i've migrated database create new tables.

please find below versions of django , social_django:

  • django: 1.10.5
  • social_django: 1.2.0

regarding pipeline used, i'm using django-pipeline it's compiling sass files css.

what might cause error?

adding pipeline below settings.py seems have fixed problem (source):

social_auth_pipeline = (     'social_core.pipeline.social_auth.social_details',     'social_core.pipeline.social_auth.social_uid',     'social_core.pipeline.social_auth.social_user',     'social_core.pipeline.user.get_username',     'social_core.pipeline.user.create_user',     'social_core.pipeline.social_auth.associate_user',     'social_core.pipeline.social_auth.load_extra_data',     'social_core.pipeline.user.user_details',     'social_core.pipeline.social_auth.associate_by_email', ) 

Comments

Popular posts from this blog

javascript - Create a stacked percentage column -

Optimising Firebase database by automatically overwriting data -

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -