balajiramani / distlib

Distributed Library Project using Django
0 stars 1 forks source link

<User: xxxx> is not JSON serializable #13

Open robinpaulson opened 10 years ago

robinpaulson commented 10 years ago

I went to the signup page, added my details and got this error,

Any ideas? This looks relevant, I'm not sure what to do with it though: https://stackoverflow.com/questions/6397206/django-json-exception-value-model-field1-field2-is-not-json-serializa

robinpaulson commented 10 years ago

Full error message: Environment:

Request Method: POST Request URL: http://127.0.0.1:8000/signup/

Django Version: 1.6.1 Python Version: 2.7.6 Installed Applications: ('django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'distlib.distlibapp', 'django.contrib.admin', 'django.contrib.admindocs') Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware')

Traceback: File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response

  1. response = middleware_method(request, response) File "/usr/lib/python2.7/dist-packages/django/contrib/sessions/middleware.py" in process_response
  2. request.session.save() File "/usr/lib/python2.7/dist-packages/django/contrib/sessions/backends/db.py" in save
  3. session_data=self.encode(self._get_session(no_load=must_create)), File "/usr/lib/python2.7/dist-packages/django/contrib/sessions/backends/base.py" in encode
  4. serialized = self.serializer().dumps(session_dict) File "/usr/lib/python2.7/dist-packages/django/core/signing.py" in dumps
  5. return json.dumps(obj, separators=(',', ':')).encode('latin-1') File "/usr/lib/python2.7/json/init.py" in dumps
  6. sort_keys=sort_keys, **kw).encode(obj) File "/usr/lib/python2.7/json/encoder.py" in encode
  7. chunks = self.iterencode(o, _one_shot=True) File "/usr/lib/python2.7/json/encoder.py" in iterencode
  8. return _iterencode(o, 0) File "/usr/lib/python2.7/json/encoder.py" in default
  9. raise TypeError(repr(o) + " is not JSON serializable")

Exception Type: TypeError at /signup/ Exception Value: is not JSON serializable