django object is not JSON serializable error after upgrading django to 1.6.5

前端 未结 3 971
生来不讨喜
生来不讨喜 2020-12-09 12:17

I have a django app which was running on 1.4.2 version and working completely fine, but recently i updated it to django 1.6.5 and facing some wierd

3条回答
  •  悲哀的现实
    2020-12-09 12:43

    Django 1.6 changed the serializer from pickle to json. pickle can serialize things that json can't.

    You can change the value of SESSION_SERIALIZER in your settings.py to get back the behaviour from Django before version 1.6.

    SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'
    

    You might want to read about session serialization in the documentation.

提交回复
热议问题