Django-Eel
Django-Eel copied to clipboard
WebSocket DISCONNECT /eel [127.0.0.1:52629]
when starting the server, there is an error appear
WebSocket HANDSHAKING /eel [127.0.0.1:52629] Exception inside application: object.__init__() takes exactly one argument (the instance to initialize) Traceback (most recent call last): File "D:\V1830Utility\venv\lib\site-packages\channels\staticfiles.py", line 44, in __call__ return await self.application(scope, receive, send) File "D:\V1830Utility\venv\lib\site-packages\channels\routing.py", line 71, in __call__ return await application(scope, receive, send) File "D:\V1830Utility\venv\lib\site-packages\channels\routing.py", line 160, in __call__ send, File "D:\V1830Utility\venv\lib\site-packages\asgiref\compatibility.py", line 33, in new_application instance = application(scope) File "D:\V1830Utility\venv\lib\site-packages\channels\generic\websocket.py", line 23, in __init__ super().__init__(*args, **kwargs) TypeError: object.__init__() takes exactly one argument (the instance to initialize) WebSocket DISCONNECT /eel [127.0.0.1:52629]
so EEL communication is not up
Fixing the routing.py file seemed to fix that issue by adding .as_asgi():
application = ProtocolTypeRouter({
# (http->django views is added by default)
"websocket": URLRouter([
url(r"^eel$", EelConsumer.as_asgi()), # do not alter this line
]),
})