尝试用daphne实现websocket的连接,启动服务器的时候出现了500错误

我尝试用daphne实现websocket的连接,写一个聊天室出来,以下是我的asgi.py
import os
import django
from django.core.asgi import get_asgi_application
from .websocket import websocket_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'MyForum.settings')
django.setup()
http_application = get_asgi_application()

async def application(scope, receive, send):

    if scope['type'] == 'http':
        await http_application(scope, receive, send)

    elif scope['type'] == 'websocket':
        await websocket_application(scope, receive, send)
    
    else:
        raise Exception('unknown scope type,'+scope['type'])

运行之后网页报错如下图

img

终端显示的错误是TypeError: application() missing 2 required positional arguments: 'receive' and 'send'