Hello,
I've just installed django-channels 2 and followed the installation 
instructions. I've got this error while trying to connect a websocket to my 
application:

Browser console:
websocketbridge.js:118 WebSocket connection to 
'ws://127.0.0.1:8000/userlocation/' failed: Error during WebSocket handshake
: Unexpected response code: 500

Django runserver:
[2018/02/05 18:12:56] WebSocket HANDSHAKING /userlocation/ [127.0.0.1:36137]
[2018/02/05 18:12:57] WebSocket DISCONNECT /userlocation/ [127.0.0.1:36137]

I cannot make the output more verbose (already running with -v 3).


consumers.py

from channels.generic.websocket import JsonWebsocketConsumer


class UserLocationConsumer(JsonWebsocketConsumer):
    def receive_json(self, content, **kwargs):
        print(content)


routing.py

from django.urls import path
from channels.routing import ProtocolTypeRouter, URLRouter
from channels.auth import AuthMiddlewareStack
from mobile.consumers import UserLocationConsumer

application = ProtocolTypeRouter({
    "websocket": AuthMiddlewareStack(
        URLRouter([
            path('userlocation/', UserLocationConsumer),
        ]))
    ,
})



Running on ubuntu 16.04 with python 3.5.2, Django 2.0.2
Am I missing something? 



-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/46ab0475-da21-4e53-9da7-3e3e4036134a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to