Skip to content

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

@hanhaohh

Description

@hanhaohh

screen shot 2014-11-14 at 8 40 36 pm
Environment:
Django Version: 1.7.1
Python Version: 2.7.3

Setting:

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'
}
}

Hosts/domain names that are valid for this site; required if DEBUG is False

See https://docs.djangoproject.com/en/1.4/ref/settings/#allowed-hosts

ALLOWED_HOSTS = []

Local time zone for this installation. Choices can be found here:

http://en.wikipedia.org/wiki/List_of_tz_zones_by_name

although not all choices may be available on all operating systems.

In a Windows environment this must be set to your system time zone.

TIME_ZONE = 'America/Chicago'

Language code for this installation. All choices can be found here:

http://www.i18nguy.com/unicode/language-identifiers.html

LANGUAGE_CODE = 'en-us'

SITE_ID = 1

If you set this to False, Django will make some optimizations so as not

to load the internationalization machinery.

USE_I18N = True

If you set this to False, Django will not format dates, numbers and

calendars according to the current locale.

USE_L10N = True

If you set this to False, Django will not use timezone-aware datetimes.

USE_TZ = True

Absolute filesystem path to the directory that will hold user-uploaded files.

Example: "/home/media/media.lawrence.com/media/"

MEDIA_ROOT = ''

URL that handles the media served from MEDIA_ROOT. Make sure to use a

trailing slash.

Examples: "http://media.lawrence.com/media/", "http://example.com/media/"

MEDIA_URL = ''

Absolute path to the directory static files should be collected to.

Don't put anything in this directory yourself; store your static files

in apps' "static/" subdirectories and in STATICFILES_DIRS.

Example: "/home/media/media.lawrence.com/static/"

STATIC_ROOT = ''

URL prefix for static files.

Example: "http://media.lawrence.com/static/"

STATIC_URL = '/static/'

Additional locations of static files

STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)

List of finder classes that know how to find static files in

various locations.

STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',

'django.contrib.staticfiles.finders.DefaultStorageFinder',

)

Make this unique, and don't share it with anybody.

SECRET_KEY = 'okfv7waevie($g9v@90mm4j(!yf22wy55w@krj%ff+t833am$h'

List of callables that know how to import templates from various sources.

TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',

'django.template.loaders.eggs.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',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'social_auth_demo.urls'

Python dotted path to the WSGI application used by Django's runserver.

WSGI_APPLICATION = 'social_auth_demo.wsgi.application'

TEMPLATE_DIRS = (
join(ROOT_PATH, 'templates'),
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
# 'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
'social_auth',
'app',
)

A sample logging configuration. The only tangible logging

performed by this configuration is to send an email to

the site admins on every HTTP 500 error when DEBUG=False.

See http://docs.djangoproject.com/en/dev/topics/logging for

more details on how to customize your logging configuration.

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',
# login 在template中可以用 "{% url socialauth_begin 'douban-oauth2' %}"
'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',
)

GITHUB_APP_ID = ''
GITHUB_API_SECRET = ''

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
Python Path:
['/Users/haohan/link',
'/Users/haohan/Desktop/dota2/lib/python2.7/site-packages/oic-0.6.0beta-py2.7.egg',
'/Users/haohan/Desktop/dota2/lib/python2.7/site-packages/pyOpenSSL-0.14-py2.7.egg',
'/Users/haohan/Desktop/dota2/lib/python2.7/site-packages/argparse-1.2.1-py2.7.egg',
'/Users/haohan/Desktop/dota2/lib/python2.7/site-packages/importlib-1.0.3-py2.7.egg',
'/Users/haohan/Desktop/dota2/lib/python2.7/site-packages/alabaster-0.6.1-py2.7.egg',
'/Users/haohan/Desktop/dota2/lib/python2.7/site-packages/Beaker-1.6.4-py2.7.egg',
'/Users/haohan/Desktop/dota2/lib/python2.7/site-packages/pyjwkest-0.4.0-py2.7.egg',
'/Users/haohan/Desktop/dota2/lib/python2.7/site-packages/Mako-1.0.0-py2.7.egg',
'/Users/haohan/Desktop/dota2/lib/python2.7/site-packages/CherryPy-3.2.4-py2.7.egg',
'/Users/haohan/Desktop/dota2/lib/python2.7/site-packages/pycrypto-2.6.1-py2.7-macosx-10.9-intel.egg',
'/Users/haohan/Desktop/dota2/lib/python2.7/site-packages/requests-2.4.3-py2.7.egg',
'/Users/haohan/Desktop/dota2/lib/python2.7/site-packages/six-1.8.0-py2.7.egg',
'/Users/haohan/Desktop/dota2/lib/python2.7/site-packages/cryptography-0.6.1-py2.7-macosx-10.9-intel.egg',
'/Users/haohan/Desktop/dota2/lib/python2.7/site-packages/PyJWT-0.3.0-py2.7.egg',
'/Users/haohan/Desktop/dota2/lib/python27.zip',
'/Users/haohan/Desktop/dota2/lib/python2.7',
'/Users/haohan/Desktop/dota2/lib/python2.7/plat-darwin',
'/Users/haohan/Desktop/dota2/lib/python2.7/plat-mac',
'/Users/haohan/Desktop/dota2/lib/python2.7/plat-mac/lib-scriptpackages',
'/Users/haohan/Desktop/dota2/Extras/lib/python',
'/Users/haohan/Desktop/dota2/lib/python2.7/lib-tk',
'/Users/haohan/Desktop/dota2/lib/python2.7/lib-old',
'/Users/haohan/Desktop/dota2/lib/python2.7/lib-dynload',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages',
'/Users/haohan/Desktop/dota2/lib/python2.7/site-packages']
Server time: Fri, 14 Nov 2014 19:29:32 -0600

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