DEV Community

loading...

Discussion on: How to Add Websockets to a Django App without Extra Dependencies

Collapse
arjhe profile image
ARJhe

pip install uvicorn
did not deal with WebSocket configuration.

# h11_impl.py L:91
self.ws_protocol_class = config.ws_protocol_class
Enter fullscreen mode Exit fullscreen mode

config.ws_protocol_class is None
so in L:264 you will get a warning.

# h11_impl.py L:264
        if upgrade_value != b"websocket" or self.ws_protocol_class is None:
            msg = "Unsupported upgrade request."
            self.logger.warning(msg)
Enter fullscreen mode Exit fullscreen mode

try: pip install uvicorn[standard]
See ref