无法导入ASGI_APPLICATION模块'myproject.routing'

问题描述 投票:0回答:2

我已经按照频道2教程,但运行py manage.py runserver后我收到此错误

File "C:\Users\Mach2\AppData\Local\Programs\Python\Python37-32\lib\site-packages\channels\routing.py", line 35, in get_default_application
    raise ImproperlyConfigured("Cannot import ASGI_APPLICATION module %r" % path)
django.core.exceptions.ImproperlyConfigured: Cannot import ASGI_APPLICATION module 'channels_test.routing'
python django django-channels channels asgi
2个回答
0
投票

您需要将此行添加到settings.py文件中。

ASGI_APPLICATION = "routing.application"

在这里找到:Cannot import ASGI_APPLICATION module while runserver using channels 2


0
投票

我已经解决了错误,我使用的是django的3.0.dev20190127224143版本,我解决了回滚到版本2.1.7的问题

© www.soinside.com 2019 - 2024. All rights reserved.