Skip to content

On linkedin,github login: AttributeError at http://llovebaimuda.herokuapp.com:8000/complete/github/ 'GithubBackend' object has no attribute 'auth_allowed' #442

@hanhaohh

Description

@hanhaohh

Hello, I tried to run a small example to integrate github and linkedin in the project. I run into this issue and I really do not know what this issue means.

screen shot 2014-11-14 at 8 40 39 pm

Request Method: GET
Request URL: http://llovebaimuda.herokuapp.com:8000/complete/github/?code=b0753de9adf58c957144&redirect_state=kJ6UyaCkL8TlOEcEeHEXVaygON4MOcfK&state=kJ6UyaCkL8TlOEcEeHEXVaygON4MOcfK
Django Version: 1.7.1
Exception Type: AttributeError
Exception Value:
'GithubBackend' object has no attribute 'auth_allowed'
Exception Location: /Users/haohan/Desktop/dota2/lib/python2.7/site-packages/social/pipeline/social_auth.py in auth_allowed, line 14
Python Executable: /Users/haohan/Desktop/dota2/bin/python
Python Version: 2.7.5

Environment:
Django : 1.7.1
Python : 2.7.5
django-social-auth : 0.7.28

settings.py:

encoding=utf-8

from os.path import abspath, dirname, basename, join
ROOT_PATH = abspath(dirname(file))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'test.db'
}
}
ALLOWED_HOSTS = []
TIME_ZONE = 'America/Chicago'
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
USE_I18N = True
USE_L10N = True
USE_TZ = True
MEDIA_ROOT = ''
MEDIA_URL = ''
STATIC_ROOT = ''
STATIC_URL = '/static/'
STATICFILES_DIRS = (

)
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)
SECRET_KEY = 'okfv7waevie($g9v@90mm4j(!yf22wy55w@krj%ff+t833am$h'

TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
)

ROOT_URLCONF = 'social_auth_demo.urls'

WSGI_APPLICATION = 'social_auth_demo.wsgi.application'

TEMPLATE_DIRS = (
join(ROOT_PATH, 'templates'),

)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'social_auth',
'app',
)

LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
}
},
'handlers': {
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
}
},
'loggers': {
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
}
}

SOCIAL_AUTH_SANITIZE_REDIRECTS = False
LOGIN_REDIRECT_URL = 'http://llovebaimuda.herokuapp.com:8000'
SOCIAL_AUTH_LOGIN_REDIRECT_URL = 'http://llovebaimuda.herokuapp.com:8000'
SOCIAL_AUTH_WEIBO_LOGIN_REDIRECT_URL = 'http://llovebaimuda.herokuapp.com:8000'

TEMPLATE_CONTEXT_PROCESSORS = (
'django.contrib.auth.context_processors.auth',
'social_auth.context_processors.social_auth_by_type_backends',
'social_auth.context_processors.social_auth_login_redirect',
)

SOCIAL_AUTH_PIPELINE = (
'social.pipeline.social_auth.social_details',
'social.pipeline.social_auth.social_uid',
'social.pipeline.social_auth.auth_allowed',
'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',

)

SOCIAL_AUTH_LOGIN_URL = '/login-url/'
SOCIAL_AUTH_LOGIN_ERROR_URL = '/login-error/'
SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/logged-in/'
SOCIAL_AUTH_NEW_USER_REDIRECT_URL = '/new-users-redirect-url/'
SOCIAL_AUTH_NEW_ASSOCIATION_REDIRECT_URL = '/new-association-redirect-url/'

SOCIAL_AUTH_SANITIZE_REDIRECTS = False

AUTHENTICATION_BACKENDS = (
'social_auth.backends.contrib.linkedin.LinkedinBackend',
'social_auth.backends.contrib.github.GithubBackend',
'social_auth.backends.contrib.weibo.WeiboBackend',
'django.contrib.auth.backends.ModelBackend',
)

WEIBO_CLIENT_KEY = '3257697480'
WEIBO_CLIENT_SECRET = '79aa66a53c97de81ba84118125cde021'

SOCIAL_AUTH_QQ_KEY = '101145292'
SOCIAL_AUTH_QQ_SECRET = '993fbbc3c7d9ed0b3a95b613c39f918d'

SOCIAL_AUTH_DOUBAN_OAUTH2_KEY = '0630fb0303a5947e1292f1090af0bd7a'
SOCIAL_AUTH_DOUBAN_OAUTH2_SECRET = 'e92927cfa3cefe4f'

GITHUB_APP_ID = '2c9c4ef0200a6ac0691f'
GITHUB_API_SECRET ='4ce11420819c133cee2ddab4fc9be165db642609'
LINKEDIN_CONSUMER_KEY = '77tchirdkqchca'
LINKEDIN_CONSUMER_SECRET ='h49zxDVFeHfNzu3K'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions