0

python | 解决 cors

 1 month ago
source link: https://benpaodewoniu.github.io/2024/03/24/python204/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

python | 解决 cors

只需要添加几行代码就好了。

但是,我这是全局 corsflask 可以精确到某一个 apicors,感兴趣的可以自己搜一下。

...
app = Flask(__name__)
CORS(app, supports_credentials=True)
...

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK