· via Vercel blog
Vercel routing middleware now supports Python for FastAPI, Flask and Django apps
Vercel's routing middleware can now be written as a Python ASGI or WSGI app that rewrites, redirects or answers requests in front of FastAPI, Flask and Django deployments.

Vercel's routing middleware feature now supports Python, giving developers who deploy FastAPI, Flask, Django and other Python frameworks a way to handle incoming requests in the same language as their applications. According to the Vercel blog, the middleware executes ahead of the application itself and can modify a request, send a redirect, or respond to it directly.
How the middleware works
Rather than living inside the application, the middleware is a standalone ASGI or WSGI app that operates apart from the main app. Vercel supplies a companion package, vercel-proxy, with utilities for building routing middleware, including a Proxy app that dispatches requests by path.
Handlers are registered against path patterns. In the example Vercel publishes, a route matching /old-blog/{slug} returns a RedirectResponse with a 308 status, permanently forwarding visitors to /blog/{slug}, while a route matching /api/{path:path} returns a ContinueResponse that attaches an x-api-version: 2 header to the request before it moves on. Any request that fails to match a defined route passes through to the application untouched, so the middleware only touches traffic it explicitly claims.
Configuration and dependencies
The proxy is wired up in vercel.toml, where a [proxy] section points an entrypoint at the middleware — entrypoint = "proxy:proxy" in the published example.
The middleware also gets an isolated dependency environment: it can import only the packages declared in the vercel.proxy dependency group of the project's pyproject.toml. Vercel shows these being added with uv, for instance uv add --group vercel.proxy vercel-proxy. Anything the middleware imports has to live in that group rather than among the application's general dependencies, which keeps the proxy layer and the app decoupled.
Why it matters
For teams running Python services on Vercel, routing rules such as redirects, rewrites and header injection no longer require leaving the Python ecosystem. The same logic can sit in the same language and toolchain as the FastAPI or Django codebase behind it, which trims the cognitive overhead of maintaining a mixed-language deployment.
The separate runtime and dependency group also mean routing decisions do not pull in the application's full dependency tree. That points to a leaner proxy layer and fewer opportunities for version conflicts between middleware and the app it fronts.
More broadly, the release fits a pattern of Vercel extending its platform beyond its JavaScript-heavy origins and treating Python workloads as a significant audience rather than an afterthought. Supporting middleware for mature frameworks like Django and Flask makes the platform more plausible for Python-first backend teams that previously had less reason to consider it.
For further details, Vercel directs developers to its Routing Middleware Python reference documentation.
- #vercel
- #python
- #middleware
- #serverless
- #cloud