
Vercel is giving Python developers more control over how requests reach their applications. In an August 26 changelog update, the company said Python projects can now use routing rules to rewrite incoming requests and set response headers before application code runs.
The capability works with Python applications built using FastAPI, Django and Flask. It closes a practical gap for teams that need to change public URLs, preserve older endpoints or apply headers without modifying and redeploying the underlying application.
Crucially, these rules run at the Vercel CDN rather than inside a Python serverless function. That means a request can be transformed before it consumes application compute, and routing changes can be published independently of a new application deployment.
Rewriting Requests Before They Reach Python
Vercel’s example uses a small FastAPI application with a route at /new:
from fastapi import FastAPI
app = FastAPI()
@app.get("/new")
def new_route() -> dict[str, str]:
return {"message": "New route!"}
A developer can then create a rewrite that sends requests from /old to /new. The public request continues to arrive through the old path, while Vercel internally directs it to the new application route.
This is useful when an API endpoint changes but existing clients, links or integrations still depend on the earlier URL. Instead of keeping duplicate handlers in the Python codebase, a team can manage the compatibility layer at the CDN. The same rules system can set response headers, giving developers another way to control responses without adding framework-specific middleware.
Rules can be created from the CDN tab in a project’s Vercel dashboard. Vercel also supports managing them through its command-line routing tools. Its published example uses an AI-assisted instruction to generate the rewrite:
vercel routes add --ai "Rewrite /old to /new" --yes
vercel routes list --diff
vercel routes publish
The workflow separates creation from publication. A new rule is staged automatically, developers can inspect the pending difference, and only then publish it to production. That review step matters for routing changes, where an incorrect path can make a working endpoint appear unavailable.
Immediate Changes With Built-In Rollback
Once published, routing rules take effect immediately across all Vercel regions, according to the company. Teams can also return to a previous rule version from the dashboard’s History tab.
For small businesses and independent builders, the update reduces the need for a full build and deployment when the required change sits at the request-routing layer. A renamed API path, for example, can be supported without touching a FastAPI or Django release that is already running in production.
There is also an operational benefit. Keeping routing behavior in Vercel provides a central place to review and roll back request-level changes, rather than scattering compatibility logic across Python frameworks and application files. Because the CDN evaluates the rules first, developers should still distinguish between infrastructure-level routing and business logic. Authentication decisions, database lookups and request validation generally remain responsibilities of the application.
The release broadens Vercel’s Python deployment support while keeping the feature focused. It does not replace framework routing. Instead, it adds a programmable layer in front of the application for rewrites and response headers, with dashboard and CLI controls designed for changes that may need to ship faster than the code itself.
Frequently asked questions
What is Vercel routing rules?
Vercel routing rules are CDN-level instructions that can rewrite incoming requests to internal paths or set response headers before traffic reaches an application. Python projects, including FastAPI, Django and Flask apps, can now use them.
How can developers create routing rules for Python projects?
Developers can create rules from the CDN tab in the Vercel project dashboard or use the Vercel CLI. The CLI supports staging a rule, reviewing the proposed changes and publishing them separately.
Do routing rule changes require a new Python deployment?
No. Vercel says the CDN evaluates the rules before requests reach the application, so routing changes can apply without a new deployment. Published rules take effect across all regions and can be rolled back through the History tab.
Sources
1 checkedHow we cover tool news: Create With's tool desk drafts these reports with AI from the sources listed above and checks them against those sources before publishing.







