diff --git a/channels/generic/websockets.py b/channels/generic/websockets.py index 7797e9a..6c0820f 100644 --- a/channels/generic/websockets.py +++ b/channels/generic/websockets.py @@ -1,4 +1,4 @@ -import json +from django.core.serializers.json import json, DjangoJSONEncoder from ..channel import Group, Channel from ..auth import channel_session_user_from_http @@ -222,4 +222,4 @@ class WebsocketDemultiplexer(JsonWebsocketConsumer): return {"text": json.dumps({ "stream": stream, "payload": payload, - })} + }, cls=DjangoJSONEncoder)} diff --git a/tox.ini b/tox.ini index 69a082a..fc0d7b4 100644 --- a/tox.ini +++ b/tox.ini @@ -18,7 +18,7 @@ deps = six redis==2.10.5 py27: mock - flake8: flake8 + flake8: flake8>=2.0,<3.0 isort: isort django-18: Django>=1.8,<1.9 django-19: Django>=1.9,<1.10