ASGI_APPLICATION = 'snp.routing.application'
routing.py:
from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
import chat.routing
application = ProtocolTypeRouter ({
'websocket': AuthMiddlewareStack(
URLRouter (
chat.routing.websocket_urlpatterns
)
)
})
我在导入ASGI_APPLICATION时遇到此错误,如何修复它
引发配置不正确(“无法导入ASGI_APPLICATION模块%r”% path)django.core.异常。配置不正确:无法导入ASGI_APPLICATION模块'snp.routing'
2条答案
按热度按时间sirbozc51#
试试这个:)
ckx4rj1h2#
在我的情况下,我只是没有安装通道库。
试试这个