I am following this guide for channels tutorial (https://media.readthedocs.org/pdf/channels/latest/channels.pdf) and after adding channels to top of INSTALLED APPS
, adding ASGI_APPLICATION = 'mysite.routing.application'
to my setting file and creating following routing.py
:
JavaScript
x
7
1
# .../routing.py
2
from channels.routing import ProtocolTypeRouter
3
4
application = ProtocolTypeRouter({
5
# (http->django views is added by default)
6
})
7
I am getting this error after running python manage.py runserver
:
ModuleNotFoundError: No module named 'asgiref.sync'
I have following versions of libraries:
JavaScript
1
5
1
Django (1.11.5)
2
asgiref (1.1.2)
3
channels (2.0.2)
4
5
Can someone help me ? I am new to channels.
Advertisement
Answer
I found out the problem was with old version of asgiref
I just had to update django and it updated also the asgiref package.