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'])
终端显示的错误是TypeError: application() missing 2 required positional arguments: 'receive' and 'send'