---
id: 20261022-T0-08
title: "Vercel路由中间件支持Python，可在请求到达应用前改写或拦截"
title_en: "Vercel Routing Middleware Now Supports Python for FastAPI and Flask"
url: https://ai.daily.yangsir.net/daily/20261022-T0-08
issue_date: 2026-10-22
publish_date: 2026-10-21T17:00:00.000Z
source_name: "Vercel Blog"
source_url: https://vercel.com/changelog/routing-middleware-now-supports-python
---

# Vercel路由中间件支持Python，可在请求到达应用前改写或拦截

Vercel宣布路由中间件正式支持Python，覆盖FastAPI、Flask、Django等主流框架。中间件以ASGI或WSGI应用形式运行在请求到达应用之前，可对请求进行改写、重定向或直接响应。开发者只需在vercel.toml中将代理入口指向自己的代理程序即可完成配置。对Python开发者而言，这意味着无需切换语言栈就能在Vercel边缘层实现鉴权、A/B测试、URL重写等逻辑，前后端工具链进一步统一。

## English Version

**Vercel Routing Middleware Now Supports Python for FastAPI and Flask**

Vercel now lets developers write routing middleware in Python for FastAPI, Flask, Django and other Python frameworks. The middleware runs as an ASGI or WSGI app before requests reach the application, and can rewrite, redirect or directly answer them. Setup requires pointing the proxy entrypoint in vercel.toml at your proxy app. For Python teams, this means auth checks, A/B tests and URL rewrites can live at the edge without leaving the Python stack.

---

**来源**：[Vercel Blog](https://vercel.com/changelog/routing-middleware-now-supports-python)

**详情页**：https://ai.daily.yangsir.net/daily/20261022-T0-08

---

*智语观潮 · Daily — https://ai.daily.yangsir.net/llms.txt*