I have an app I'm moving from local dev (mac, python 2.7.2, django 1.5.4) to WebFaction (python 2.7.5.
I'm storing record ids like so:
section_ids = list(sections.values_list('id', flat=True))
request.session['query.section_ids.last'] = section_ids
works fine locally and fails on WF with:
-- I'm storing record ids like so:
section_ids = list(sections.values_list('id', flat=True))
request.session['query.section_ids.last'] = section_ids
works fine locally and fails on WF with:
(as an example)
[10892L, 10891L] is not JSON serializable
This is the traceback...
File "/home/leedhinde/webapps/myapp/lib/python2.7/django/core/handlers/base.py" in get_response
187. response = middleware_method(request, response)
File "/home/leedhinde/webapps/myapp/lib/python2.7/django/contrib/sessions/middleware.py" in process_response
38. request.session.save()
File "/home/leedhinde/webapps/myapp/lib/python2.7/django/contrib/sessions/backends/db.py" in save
51. session_data=self.encode(self._get_session(no_load=must_create)),
File "/home/leedhinde/webapps/myapp/lib/python2.7/django/contrib/sessions/backends/base.py" in encode
84. serialized = self.serializer().dumps(session_dict)
File "/home/leedhinde/webapps/myapp/lib/python2.7/django/core/signing.py" in dumps
100. return json.dumps(obj, separators=(',', ':')).encode('latin-1')
File "/usr/local/lib/python2.7/json/__init__.py" in dumps
250. sort_keys=sort_keys, **kw).encode(obj)
File "/usr/local/lib/python2.7/json/encoder.py" in encode
207. chunks = self.iterencode(o, _one_shot=True)
File "/usr/local/lib/python2.7/json/encoder.py" in iterencode
270. return _iterencode(o, 0)
File "/usr/local/lib/python2.7/json/encoder.py" in default
184. raise TypeError(repr(o) + " is not JSON serializable")
I'm not clear why this wouldn't work. I also haven't figured out testing session updating in the shell for simpler testing.
Any pointers would be appreciated.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2BePoMzPm9c4YiFkBBdvQ9uDwOnezxGutmgSJvc5kw8d7J-6QQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment