python - Django Social WrongBackend Error -
i pretty new django , noob django-social-auth. settings.py code (from installed app social_auth_config) :
django_apps = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.admin', 'django.contrib.admindocs', ) thied_party_apps = ( #'south', 'captcha', 'social_auth', ) my_apps = ( 'account', 'dashboard', ) installed_apps = django_apps + thied_party_apps + my_apps #------------------------------------------------- social auth ------------------- login_url = 'account/login/' login_redirect_url = 'dashboard/' login_error_url = '/login/' authentication_backends = ( 'social_auth.backends.contrib.github.githubbackend', 'django.contrib.auth.backends.modelbackend', ) template_context_processors = ( "social_auth.context_processors.social_auth_by_type_backends", "django.contrib.auth.context_processors.auth", ) social_auth_default_username = 'nal_auth_user' social_auth_uid_length = 16 social_auth_association_handle_length = 16 social_auth_nonce_server_url_length = 16 social_auth_association_server_url_length = 16 social_auth_association_handle_length = 16 social_auth_enabled_backends = ('github',) github_api_key = '2f1129e79efd4263bf88' github_api_secret = '6f4cea73e6100d0a994fa5bfff44f7220432c87d'
in urls.py:
from django.conf.urls import patterns, include, url django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^$', 'website.views.index', name='index'), url(r'auth/',include('social_auth.urls')), url(r'account/',include('account.urls',namespace="account")), url(r'dashboard/',include('dashboard.urls',namespace="dashboard")), url(r'^admin/doc/', include('django.contrib.admindocs.urls')), url(r'^admin/', include(admin.site.urls)), )
in account.models login page have show login url..
<a href="{% url 'socialauth_begin' 'github' %}">login github</a>
but problem when ever click link gives me error
wrongbackend @ /auth/login/github/ incorrect authentication service "github" request method: request url: http://127.0.0.1:8000/auth/login/github/ django version: 1.5.4 exception type: wrongbackend exception value: incorrect authentication service "github"
i tried use google , gives me same error except in github google. tried similar questions in stackoverflow.
please me if can :)
check version of library of django_sociao_auth, "this library deprecated in favor of python-social-auth. right library depends directly on python-social-auth , should considered migration step". check if
settings_key_name = 'github_app_id' settings_secret_name = 'github_api_secret'
in classgithubauth
then try add this
social_auth_pipeline = ( 'social_auth.backends.pipeline.social.social_auth_user', 'social_auth.backends.pipeline.associate.associate_by_email', 'social_auth.backends.pipeline.misc.save_status_to_session', 'social_auth.backends.pipeline.user.create_user', 'social_auth.backends.pipeline.social.associate_user', 'social_auth.backends.pipeline.social.load_extra_data', 'social_auth.backends.pipeline.user.update_user_details', 'social_auth.backends.pipeline.misc.save_status_to_session', )
Comments
Post a Comment