OFICIAL Vercel Blog

Routing Middleware now supports Python

What happened
Based on Vercel Blog · Oct 21, 2026

Vercel now allows Python-based routing middleware for frameworks like FastAPI and Flask, enabling request rewrites, redirects, or responses before they reach the main application.

Routing Middleware now supports Python
Vercel Blog — Vercel
Key points
·
Python routing middleware now supported on Vercel for FastAPI, Flask, and Django frameworks
·
Middleware runs separately as ASGI or WSGI app using vercel.proxy dependency group in pyproject.toml
·
Middleware can rewrite, redirect, or answer requests before they reach the main application

Vercel has introduced support for writing routing middleware in Python, expanding beyond its existing JavaScript and TypeScript capabilities. Developers can now use Python frameworks such as FastAPI, Flask, and Django to create middleware that processes requests before they reach the main application. This middleware operates as a separate ASGI or WSGI app, ensuring isolation from the primary application logic.

The middleware is configured through the vercel.proxy dependency group in the pyproject.toml file, where developers must include any additional packages required by their middleware. The vercel-proxy package provides utilities, including a Proxy app, to facilitate routing based on path matching. Requests that do not match any defined routes are forwarded unchanged to the main application.

Routing middleware in Python can rewrite, redirect, or directly respond to incoming requests, offering greater flexibility in request handling. This feature is particularly useful for tasks such as authentication, request modification, or conditional routing before the request reaches the application logic. The implementation remains consistent with Vercel's existing middleware architecture.

For detailed implementation guidance, Vercel provides a Routing Middleware Python reference, which outlines the setup process and available utilities. This addition aligns with Vercel's broader strategy to support multiple programming languages for edge functions and middleware, enhancing developer choice and application performance.

Original source → Deals on Clipraptor.com →