# Routing Middleware now supports Python

DevFeed: [Routing Middleware now supports Python](<https://devfeed.tech/articles/routing-middleware-now-supports-python-92975.md>)

Original publisher: [Read original article](<https://vercel.com/changelog/routing-middleware-now-supports-python>)

Author: Daniel Park

Published: 2026-10-21T16:36:23.454672Z

Content type: release

Language: en

Sources: [Vercel News](<https://devfeed.tech/sources/vercel-news.md>)

Topics: [middleware](<https://devfeed.tech/topics/middleware.md>), [Python](<https://devfeed.tech/topics/python.md>), [ASGI](<https://devfeed.tech/topics/asgi.md>), [Django](<https://devfeed.tech/topics/django.md>), [FastAPI](<https://devfeed.tech/topics/fastapi.md>)

Tags: [app](<https://devfeed.tech/tags/app.md>), [dependency](<https://devfeed.tech/tags/dependency.md>), [django](<https://devfeed.tech/tags/django.md>), [fastapi](<https://devfeed.tech/tags/fastapi.md>), [flask](<https://devfeed.tech/tags/flask.md>), [frameworks](<https://devfeed.tech/tags/frameworks.md>), [middleware](<https://devfeed.tech/tags/middleware.md>), [package](<https://devfeed.tech/tags/package.md>), [packages](<https://devfeed.tech/tags/packages.md>), [proxy](<https://devfeed.tech/tags/proxy.md>), [python](<https://devfeed.tech/tags/python.md>), [redirect](<https://devfeed.tech/tags/redirect.md>), [rewrite](<https://devfeed.tech/tags/rewrite.md>), [route](<https://devfeed.tech/tags/route.md>), [routing](<https://devfeed.tech/tags/routing.md>), [utilities](<https://devfeed.tech/tags/utilities.md>), [uv](<https://devfeed.tech/tags/uv.md>), [vercel](<https://devfeed.tech/tags/vercel.md>)

## AI overview

Python routing middleware runs before the main app and can rewrite, redirect, or answer requests. Configure the `proxy` entrypoint in `vercel.toml` to point to an ASGI or WSGI app that runs separately, and put its imported packages in the `vercel.proxy` dependency group in `pyproject.toml` (for example, install `vercel-proxy` with `uv add --group vercel.proxy vercel-proxy`). The package includes a `Proxy` app for path-based routing; handlers can, for example, redirect a legacy blog path or continue an API request with an added header. Requests without a matching route continue to the main app unchanged.

## Source excerpt

You can now write routing middleware in Python for FastAPI, Flask, Django, and other Python frameworks. It runs before requests reach your app, and can rewrite, redirect, or answer them. To set it up, point the proxy entrypoint in vercel.toml at your proxy: Your middleware is an ASGI or WSGI app that runs separately from your main app, with only the packages in the vercel.proxy dependency group of your pyproject.toml. Add the packages your middleware imports to that group: The vercel-proxy package provides utilities for writing routing middleware on Vercel, including a Proxy app that routes requests by path: Requests that match no route continue to your app unchanged. For more information, see the Routing Middleware Python reference. Read more