DEV Community

loading...

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

Collapse
lautaronavarro profile image
Lautaro Navarro

Hi Jayden!
First of all I'd like to thank you for this amazing post!
I've been following this post step by step and I'm getting an error when I'm trying to start up de Uvicorn server, which I guess it's related to a breaking change on a dependency.
The error is the following
"module 'websockets' has no attribute 'WebSocketServerProtocol'"
Do you know which is the path to continue?

Collapse
lautaronavarro profile image
Lautaro Navarro

Well I was able to find the problem, your project must not be called websockets.

Collapse
lautaronavarro profile image
Lautaro Navarro

I realized that running it from the same directory that the asgi.py file it works, so it looks like I'm doing something wrong with the path :/
Running "uvicorn asgi:application" from the asgi file directory works
Running "uvicorn websockets.asgi:application" from the project's directory does not work (my project is called websockets)