首先下载跨域的插件:
pip install django-cors-headers
第一步:
第二步:
第三步:
最后,一定要配置访问域名:
Windows:用记事本打开 ,将主机地址和要访问的前端地址注册在上面。
要记得保存!!!!! ctrl+s 保存!!!!
C:\Windows\System32\drivers\etc\hosts
跨域参考文档:
参考文档https://github.com/ottoyiu/django-cors-headers/https://github.com/ottoyiu/django-cors-headers/