Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
尝试使用Facebook登录Django服务器时出现内部服务器错误_Django_Facebook_Django Rest Framework_Django Allauth_Django Rest Auth - Fatal编程技术网

尝试使用Facebook登录Django服务器时出现内部服务器错误

尝试使用Facebook登录Django服务器时出现内部服务器错误,django,facebook,django-rest-framework,django-allauth,django-rest-auth,Django,Facebook,Django Rest Framework,Django Allauth,Django Rest Auth,我有一个Django REST服务器,最近我用Python 2.7更新到了3.4。服务器在Django之上使用Django REST框架,Django allauth和Django REST auth支持Facebook登录 现在,在更新之后,我不能再使用Facebook登录服务器了。向服务器发送帖子时,出现以下错误: Internal Server Error: /rest-auth/facebook/ Traceback (most recent call last): File "C:

我有一个Django REST服务器,最近我用Python 2.7更新到了3.4。服务器在Django之上使用Django REST框架,Django allauth和Django REST auth支持Facebook登录

现在,在更新之后,我不能再使用Facebook登录服务器了。向服务器发送帖子时,出现以下错误:

Internal Server Error: /rest-auth/facebook/
Traceback (most recent call last):
  File "C:\Python34\lib\site-packages\django\core\handlers\base.py", line 132, in get_response response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "C:\Python34\lib\site-packages\django\views\decorators\csrf.py", line 58, in wrapped_view return view_func(*args, **kwargs)
  File "C:\Python34\lib\site-packages\django\views\generic\base.py", line 71, in view return self.dispatch(request, *args, **kwargs)
  File "C:\Python34\lib\site-packages\rest_framework\views.py", line 452, in dispatch response = self.handle_exception(exc)
  File "C:\Python34\lib\site-packages\rest_framework\views.py", line 449, in dispatch response = handler(request, *args, **kwargs)
  File "C:\Python34\lib\site-packages\rest_auth\views.py", line 51, in post if not self.serializer.is_valid():
  File "C:\Python34\lib\site-packages\rest_framework\serializers.py", line 187, in is_valid self._validated_data = self.run_validation(self.initial_data)
  File "C:\Python34\lib\site-packages\rest_framework\serializers.py", line 370, in run_validation value = self.validate(value)
  File "C:\Python34\lib\site-packages\rest_auth\registration\serializers.py", line 31, in validate token.account = login.account
  File "C:\Python34\lib\site-packages\django\db\models\fields\related.py", line 668, in __set__ (value, self.field.rel.to._meta.object_name)
  File "C:\Python34\lib\site-packages\django\db\models\base.py", line 496, in __repr__ u = six.text_type(self)
  File "C:\Python34\lib\site-packages\allauth\socialaccount\models.py", line 104, in __str__ return force_text(self.user)
  File "C:\Python34\lib\site-packages\django\db\models\fields\related.py", line 608, in __get__ "%s has no %s." % (self.field.model.__name__, self.field.name)
django.db.models.fields.related.RelatedObjectDoesNotExist: SocialAccount has no user.
[13/Apr/2015 08:53:30]"POST /rest-auth/facebook/ HTTP/1.1" 500 115908
这可能是什么原因造成的?在更新Python和库之后,我没有对代码做任何更改,而且在更新之前它就工作了。我删除了旧的数据库,并通过syncdb创建了一个新的数据库,但没有帮助


提前感谢。

RelatedObject
已在Django 1.8中删除,取而代之的是
ForeignObjectRel


您正在使用的allauth版本不支持Django 1.8。

是否有解决方法?我将django 1.9与django allauth(0.25.2)一起使用。我也犯了同样的错误。