我已经为我的网站安装了django-facebook-4.0.8。该软件包已成功安装,但会出现不同类型的错误。请帮忙!
我正在使用 AUTH_PROFILE_MODULE = 'django_facebook.FacebookProfile'。
它将用户注册为AUTH 用户,但未在 django_facebook_facebookprofile 表中注册。注册后,它给出了“AnonymousUser”对象没有属性“后端”
这是我的回溯:
Environment:
Request Method: POST
Request URL: http://pydev.aviesta.com/facebook/connect/?facebook_login=1
Django Version: 1.4.2
Python Version: 2.6.6
Installed Applications:
['mezzanine.boot',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.redirects',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.sitemaps',
'django.contrib.staticfiles',
'cartridge.shop',
'mezzanine.conf',
'mezzanine.core',
'mezzanine.generic',
'mezzanine.blog',
'mezzanine.forms',
'mezzanine.pages',
'mezzanine.galleries',
'mezzanine.twitter',
'mezzanine.accounts',
'user_attr',
'facebook',
'django_facebook',
'django_extensions',
'filebrowser_safe',
'south',
'grappelli_safe',
'django.contrib.admin',
'django.contrib.comments']
Installed Middleware:
['django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.redirects.middleware.RedirectFallbackMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'cartridge.shop.middleware.ShopMiddleware',
'mezzanine.core.request.CurrentRequestMiddleware',
'mezzanine.core.middleware.TemplateForDeviceMiddleware',
'mezzanine.core.middleware.TemplateForHostMiddleware',
'mezzanine.core.middleware.AdminLoginInterfaceSelectorMiddleware',
'mezzanine.pages.middleware.PageMiddleware']
Traceback:
File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py" in get_response
response = middleware_method(request, callback, callback_args, callback_kwargs) File "/usr/lib/python2.6/site-packages/mezzanine/pages/middleware.py" in process_view
return view_func(request, *view_args, **view_kwargs) File "/usr/lib/python2.6/site-packages/django/views/decorators/csrf.py" in wrapped_view
return view_func(*args, **kwargs) File "/usr/lib/python2.6/site-packages/django_facebook/decorators.py" in _wrapped_view
return view_func(request, *args, **kwargs) File "/usr/lib/python2.6/site-packages/django_facebook/views.py" in connect
response = _connect(request, facebook_login) File "/usr/lib/python2.6/site-packages/django_facebook/views.py" in _connect
action, user = connect_user(request) File "/usr/lib/python2.6/site-packages/django_facebook/connect.py" in connect_user
user = _login_user(request, facebook, auth_user, update=False) File "/usr/lib/python2.6/site-packages/django_facebook/connect.py" in _login_user
login(request, authenticated_user) File "/usr/lib/python2.6/site-packages/django/contrib/auth/__init__.py" in login
request.session[BACKEND_SESSION_KEY] = user.backend File "/usr/lib/python2.6/site-packages/django/utils/functional.py" in inner
return func(self._wrapped, *args)
Exception Type: AttributeError at /facebook/connect/
Exception Value: 'AnonymousUser' object has no attribute 'backend'