我已经根据自述文件设置了 allauth。同步数据库等。
但是,当我尝试在管理员中设置社交应用程序时,提供者下拉列表为空。
我试图在 providers/ init .py 文件中打印 get_list() (我假设这是 models.py 和 as_choices() 方法使用的方法。
您对我在哪里做错了有任何指示吗?:)
任何帮助是极大的赞赏。
亲切的问候,
皮特
我的设置文件(大部分):
from os.path import abspath, basename, dirname, join, normpath
DJANGO_ROOT = dirname(dirname(abspath(__file__)))
SITE_NAME = basename(DJANGO_ROOT)
SITE_ROOT = dirname(DJANGO_ROOT)
sys.path.append(SITE_ROOT)
sys.path.append(normpath(join(DJANGO_ROOT, 'apps')))
sys.path.append(normpath(join(DJANGO_ROOT, 'libs')))
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
#Authentication/signup backend
'project.apps.allauth',
'project.apps.allauth.account',
'project.apps.allauth.socialaccount',
'project.apps.allauth.socialaccount.providers.facebook',
'django.contrib.admin',
TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.request',
'django.contrib.auth.context_processors.auth',
'project.apps.allauth.account.context_processors.account',
'project.apps.allauth.socialaccount.context_processors.socialaccount',
)
ACCOUNT_ADAPTER = 'project.apps.allauth.account.adapter.DefaultAccountAdapter'
ACCOUNT_AUTHENTICATION_METHOD = 'username_email'
ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_PASSWORD_MIN_LENGTH = 8
ACCOUNT_SIGNUP_PASSWORD_VERIFICATION = False
ACCOUNT_UNIQUE_EMAIL = True
ACCOUNT_USERNAME_REQUIRED = False
SOCIALACCOUNT_PROVIDERS = {'facebook': {'SCOPE': ['email'], 'AUTH_PARAMS': {'auth_type': 'reauthenticate'}, 'METHOD': 'js_sdk', 'LOCALE_FUNC': 'path.to.callable'}}
我的网址文件:
urlpatterns = patterns('',
#(r'^/$', include('project.apps.main.urls')),
#(r'^account/$', include('project.apps.account.urls')),
(r'^admin/', include(admin.site.urls)),
(r'^registration/', include('project.apps.allauth.urls')),
)