Python 懒惰对象返回了意外的类型。验证到管理员页面时出错
我正在尝试使用社交身份验证 将其所需设置加载到my app settings.py后,我必须进入管理页面才能输入社交令牌 只要我登录到管理页面。它给了我这个错误:Python 懒惰对象返回了意外的类型。验证到管理员页面时出错,python,django,django-admin,Python,Django,Django Admin,我正在尝试使用社交身份验证 将其所需设置加载到my app settings.py后,我必须进入管理页面才能输入社交令牌 只要我登录到管理页面。它给了我这个错误: Environment: Request Method: GET Request URL: http://127.0.0.1:8000/admin/ Django Version: 1.5 Python Version: 2.7.1 Installed Applications:
Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/
Django Version: 1.5
Python Version: 2.7.1
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'main',
'allauth',
'allauth.account',
'allauth.socialaccount')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')
Traceback:
File "/Library/Python/2.7/site-packages/django/core/handlers/base.py" in get_response
response = callback(request, *callbackargs, **callback_kwargs) File "/Library/Python/2.7/site-packages/django/contrib/admin/sites.py" in wrapper
return self.admin_view(view, cacheable)(*args, **kwargs) File "/Library/Python/2.7/site-packages/django/utils/decorators.py" in _wrapped_view
response = view_func(request, *args, **kwargs) File "/Library/Python/2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
response = view_func(request, *args, **kwargs) File "/Library/Python/2.7/site-packages/django/contrib/admin/sites.py" in inner
return view(request, *args, **kwargs) File "/Library/Python/2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
response = view_func(request, *args, **kwargs) File "/Library/Python/2.7/site-packages/django/contrib/admin/sites.py" in index
app['models'].sort(key=lambda x: x['name']) File "/Library/Python/2.7/site-packages/django/utils/functional.py" in lt
other = other.cast() File "/Library/Python/2.7/site-packages/django/utils/functional.py" in __cast
return self.text_cast() File "/Library/Python/2.7/site-packages/django/utils/functional.py" in __text_cast
return func(*self.args, **self.kw) File "/Library/Python/2.7/site-packages/django/utils/text.py" in
capfirst = lambda x: x and forcetext(x)[0].upper() + force_text(x)[1:] File "/Library/Python/2.7/site-packages/django/utils/functional.py" in __wrapper
raise TypeError("Lazy object returned unexpected type.")
Exception Type: TypeError at /admin/
Exception Value: Lazy object returned unexpected type
我应该做什么来解决这个问题,为什么会出现异常?
任何帮助或想法都将不胜感激。
Kind认为那里有一个函数,它迫使文本去做什么。。。unicode?。。。在一种情况下为forcetextx,在第二种情况下为forcetextx。在一种情况下,它可能返回错误消息,因为方法不存在
Alan该函数将文本强制转换为。。。unicode?。。。在一种情况下为forcetextx,在第二种情况下为forcetextx。在一种情况下,它可能返回错误消息,因为方法不存在 艾伦