python - Why I am getting TypeError on production server where I am trying to save data in the session? -


environment:

request method: request url: django_server_running_on_apache  django version: 1.3.3 python version: 2.7.3  traceback: file "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response   178.                 response = middleware_method(request, response) file "/usr/local/lib/python2.7/dist-packages/django/contrib/sessions/middleware.py" in process_response   36.                 request.session.save() file "/usr/local/lib/python2.7/dist-packages/django/contrib/sessions/backends/file.py" in save   121.                     os.write(output_file_fd, self.encode(session_data)) file "/usr/local/lib/python2.7/dist-packages/django/contrib/sessions/backends/base.py" in encode   93.         pickled = pickle.dumps(session_dict, pickle.highest_protocol)  exception type: typeerror @ / exception value: expected string or unicode object, nonetype found 

it recommended store scalar objects in session. pickel fails serialize other objects.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -