0
ValueError at /accounts/login/
**need more than 1 value to unpack**
Request Method: GET
Request URL:    http://localhost:8000/accounts/login/
Django Version: 1.6
Exception Type: ValueError
Exception Value:    
need more than 1 value to unpack
Exception Location: C:\xampp\htdocs\Aptana Workspace\ktj14\allauth\utils.py in import_attribute, line 76

This is the error messsage i get with {% providers_media_js %}

my settings.py file

TEMPLATE_CONTEXT_PROCESSORS = (
    'django.core.context_processors.request',
    'django.contrib.auth.context_processors.auth',
    'allauth.account.context_processors.account',
    'allauth.socialaccount.context_processors.socialaccount'
)

AUTHENTICATION_BACKENDS = (
                           'django.contrib.auth.backends.ModelBackend',
                           'allauth.account.auth_backends.AuthenticationBackend',
)

SOCIALACCOUNT_PROVIDERS = {
                'facebook':{    'SCOPE':['email'],
                                'AUTH_PARAMS':{'auth_type':'reauthenticate'},
                                'METHOD':'js_sdk',
                                'LOCALE_FUNC':'en-US'
                                },
                'google':{    'SCOPE':['email'],
                                'AUTH_PARAMS':{'auth_type':'reauthenticate'},
                                'METHOD':'js_sdk',
                                'LOCALE_FUNC':'en-US'
                                }

                           }

These are the allauth related settings i've used. allauth is added in the INSTALLED_APPS

4

1 回答 1

1

LOCALE_FUNC应设置为可调用函数的完整路径。这里"path.to.callable"只是一个例子,不能从字面上理解,因为这意味着需要创建一个"path/to.py"内部def callable定义的文件。

我建议您避免使用可调用的路径并直接内联可调用,如下所示:

'LOCALE_FUNC':  lambda request: 'en-US
于 2013-06-10T20:01:58.163 回答