django social auth facebook错误

时间:2014-01-05 13:49:30

标签: django json django-views django-socialauth django-facebook

当地版本的Django social_auth facebook后端运行良好,但网站的生产版本响应时出现以下错误:

Traceback (most recent call last):

File "/home/my_user/my_project/venv/lib/python2.7/site-packages/django/core/handlers/base.py", line 201, in get_response
response = middleware_method(request, response)

File "/home/my_user/my_project/venv/lib/python2.7/site-packages/django/contrib/sessions/middleware.py", line 38, in process_response
request.session.save()

File "/home/my_user/my_project/venv/lib/python2.7/site-packages/django/contrib/sessions/backends/cached_db.py", line 62, in save
super(SessionStore, self).save(must_create)

File "/home/my_user/my_project/venv/lib/python2.7/site-packages/django/contrib/sessions/backends/db.py", line 57, in save
session_data=self.encode(self._get_session(no_load=must_create)),

File "/home/my_user/my_project/venv/lib/python2.7/site-packages/django/contrib/sessions/backends/base.py", line 87, in encode
serialized = self.serializer().dumps(session_dict)

File "/home/my_user/my_project/venv/lib/python2.7/site-packages/django/core/signing.py", line 88, in dumps
return json.dumps(obj, separators=(',', ':')).encode('latin-1')

File "/usr/lib/python2.7/json/__init__.py", line 238, in dumps
**kw).encode(obj)

File "/usr/lib/python2.7/json/encoder.py", line 201, in encode
chunks = self.iterencode(o, _one_shot=True)

File "/usr/lib/python2.7/json/encoder.py", line 264, in iterencode
return _iterencode(o, 0)

File "/usr/lib/python2.7/json/encoder.py", line 178, in default
raise TypeError(repr(o) + " is not JSON serializable")

TypeError: <social_auth.backends.facebook.FacebookBackend object at 0x7fd0543fe710> is not JSON serializable 

唯一的区别是本地版本使用django1.5但生产使用django1.6这可能是一个原因,我该怎么办? Django_social_auth 0.7.27

0 个答案:

没有答案