安装django-cors-headers pip install django-cors-headers 将corsheaders 添加到INSTALLED_APPS 设置 MIDDLEWARE *添加 CORS_ORIGIN_ALLOW_ALL = True