当前位置:网站首页>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)
边栏推荐
- Basic introduction to the control of the row component displaying its children in the horizontal array (tutorial includes source code)
- C language to get program running time
- Flet tutorial 12 stack overlapping to build a basic introduction to graphic and text mixing (tutorial includes source code)
- Data verification before and after JSON to map -- custom UDF
- Judge whether a number is a prime number (prime number)
- [brush questions] effective Sudoku
- 【729. 我的日程安排錶 I】
- Use byte stream to read Chinese from file to console display
- Allusions of King Xuan of Qi Dynasty
- Jarvis OJ 简单网管协议
猜你喜欢
Precision epidemic prevention has a "sharp weapon" | smart core helps digital sentinels escort the resumption of the city
Embedded-c Language-2
阈值同态加密在隐私计算中的应用:解读
【机器人坐标系第一讲】
American chips are no longer proud, and Chinese chips have successfully won the first place in emerging fields
High number | summary of calculation methods of volume of rotating body, double integral calculation of volume of rotating body
The first EMQ in China joined Amazon cloud technology's "startup acceleration - global partner network program"
美国芯片傲不起来了,中国芯片成功在新兴领域夺得第一名
浏览器渲染原理以及重排与重绘
[729. My Schedule i]
随机推荐
外盘期货平台如何辨别正规安全?
【性能测试】全链路压测
【剑指 Offer】61. 扑克牌中的顺子
The first lesson of EasyX learning
[Jianzhi offer] 66 Build product array
WR | 西湖大学鞠峰组揭示微塑料污染对人工湿地菌群与脱氮功能的影响
PHP talent recruitment system development source code recruitment website source code secondary development
网上办理期货开户安全吗?网上会不会骗子比较多?感觉不太靠谱?
Precision epidemic prevention has a "sharp weapon" | smart core helps digital sentinels escort the resumption of the city
The third lesson of EasyX learning
国内首家 EMQ 加入亚马逊云科技「初创加速-全球合作伙伴网络计划」
【机器人坐标系第一讲】
飞桨EasyDL实操范例:工业零件划痕自动识别
拷贝方式之DMA
深耕5G,芯讯通持续推动5G应用百花齐放
【729. 我的日程安排表 I】
Using C language to realize palindrome number
【7.7直播预告】《SaaS云原生应用典型架构》大咖讲师教你轻松构建云原生SaaS化应用,难题一一击破,更有华为周边好礼等你领!
Timestamp strtotime the day before or after the date
Games101 notes (II)