1.安装依赖包 pip install channels channels-redis 2.settings.py 修改加上支持 INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'MyWeb.apps.MywebConfig', "channels