<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Flask on 心之所向 素履所往</title>
		<link>http://www.mi-dong.com/tags/flask/</link>
		<description>Recent content in Flask on 心之所向 素履所往</description>
		<generator>Hugo</generator>
		<language>zh</language>
		
		
		
			<copyright>All rights reserved - 2026</copyright>
		
		
			<lastBuildDate>Thu, 06 Jun 2024 11:41:57 +0800</lastBuildDate>
		
			<atom:link href="http://www.mi-dong.com/tags/flask/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Flask 解决跨域问题</title>
				<link>http://www.mi-dong.com/post/python/flask-%E8%A7%A3%E5%86%B3%E8%B7%A8%E5%9F%9F%E9%97%AE%E9%A2%98/</link>
				<pubDate>Thu, 06 Jun 2024 11:41:57 +0800</pubDate>
				<guid>http://www.mi-dong.com/post/python/flask-%E8%A7%A3%E5%86%B3%E8%B7%A8%E5%9F%9F%E9%97%AE%E9%A2%98/</guid>
				<description>&lt;h3 id=&#34;使用步骤&#34;&gt;使用步骤&lt;/h3&gt;&#xA;&lt;h4 id=&#34;引入库&#34;&gt;引入库&lt;/h4&gt;&#xA;&lt;pre&gt;&lt;code&gt;pip install flask-cors&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h4 id=&#34;配置&#34;&gt;配置&lt;/h4&gt;&#xA;&lt;p&gt;flask-cors 有两种用法，一种为全局使用，一种对指定的路由使用&lt;/p&gt;&#xA;&lt;p&gt;1.使用 CORS函数 配置全局路由&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-Python&#34;&gt;from flask import Flask, request&#xA;from flask_cors import CORS&#xA;&#xA;app = Flask(__name__)&#xA;CORS(app, supports_credentials=True)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;其中 CORS 提供了一些参数帮助我们定制一下操作。&lt;/p&gt;</description>
			</item>
			<item>
				<title>Flask 框架介绍</title>
				<link>http://www.mi-dong.com/post/python/flask%E6%A1%86%E6%9E%B6%E4%BB%8B%E7%BB%8D/</link>
				<pubDate>Thu, 06 Jun 2024 11:41:57 +0800</pubDate>
				<guid>http://www.mi-dong.com/post/python/flask%E6%A1%86%E6%9E%B6%E4%BB%8B%E7%BB%8D/</guid>
				<description>&lt;p&gt;Flask是Python中一个轻量级web框架，路由机制简单便捷，上手很快，生产环境需要搭配 uwsgi 进行使用。&#xA;python 中主要引入：&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-python&#34;&gt;from flask import Flask, request, Response, jsonify&#xA;&#xA;app = Flask(__name__)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;以上是Flask初始化，那么接下来最主要的是如何配置路由？&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
