Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
812 views
in Technique[技术] by (71.8m points)

python - Django channels: No module named 'asgiref.sync'

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:

# .../routing.py
from channels.routing import ProtocolTypeRouter

application = ProtocolTypeRouter({
      # (http->django views is added by default)
})

I am getting this error after running python manage.py runserver:

ModuleNotFoundError: No module named 'asgiref.sync'

I have following versions of libraries:

Django (1.11.5)
asgiref (1.1.2)
channels (2.0.2)
...

Can someone help me ? I am new to channels.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I found out the problem was with old version of asgiref I just had to update django and it updated also the asgiref package.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...