当前位置:网站首页>flask解决CORS ERR 问题
flask解决CORS ERR 问题
2022-07-05 16:36:00 【go_flush】
- 首先呢,你要确定你的nginx 中已配置允许跨域
例如:
在location中添加如下:
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE;
然后安装flask 解决跨域的包
pip install flask_cors使用方法如下:
from flask_cors import CORS
app = Flask(__name__)
CORS(app,supports_credentials=True)
边栏推荐
- 网站页面禁止复制内容 JS代码
- Embedded UC (UNIX System Advanced Programming) -2
- Benji Banas membership pass holders' second quarter reward activities update list
- 【7.7直播预告】《SaaS云原生应用典型架构》大咖讲师教你轻松构建云原生SaaS化应用,难题一一击破,更有华为周边好礼等你领!
- WR | 西湖大学鞠峰组揭示微塑料污染对人工湿地菌群与脱氮功能的影响
- Basic introduction to the control of the row component displaying its children in the horizontal array (tutorial includes source code)
- 浏览器渲染原理以及重排与重绘
- Application of threshold homomorphic encryption in privacy Computing: Interpretation
- Games101 notes (I)
- 2022 年 Q2 加密市场投融资报告:GameFi 成为投资关键词
猜你喜欢

thinkphp3.2.3

thinkphp模板的使用

Wsl2.0 installation

Jarvis OJ shell流量分析

【729. 我的日程安排錶 I】

Embedded UC (UNIX System Advanced Programming) -3

Etcd build a highly available etcd cluster

【性能测试】jmeter+Grafana+influxdb部署实战

Judge whether a number is a prime number (prime number)

Read the basic grammar of C language in one article
随机推荐
Deep learning plus
Timestamp strtotime the day before or after the date
Thoughtworks 全球CTO:按需求构建架构,过度工程只会“劳民伤财”
thinkphp模板的使用
How to install MySQL
2022 年 Q2 加密市场投融资报告:GameFi 成为投资关键词
Application of threshold homomorphic encryption in privacy Computing: Interpretation
npm安装
Android privacy sandbox developer preview 3: privacy, security and personalized experience
Apple has abandoned navigationview and used navigationstack and navigationsplitview to implement swiftui navigation
Embedded-c Language-4
Yarn common commands
thinkphp3.2.3
[Jianzhi offer] 62 The last remaining number in the circle
Jarvis OJ Telnet Protocol
dried food! Semi supervised pre training dialogue model space
Judge whether a number is a prime number (prime number)
启牛商学院股票开户安全吗?靠谱吗?
Using C language to realize palindrome number
Read the basic grammar of C language in one article