https://github.com/ottoyiu/django-cors-headers/
安装django-cors-headers模块
在settings.py中配置# 注册appINSTALLED_APPS = [ ... 'corsheaders']# 添加中间件MIDDLEWARE = [ ... 'corsheaders.middleware.CorsMiddleware']
# 允许跨域源CORS_ORIGIN_ALLOW_ALL = True