Python projects now support routing rules
By Steven Van ·
Python projects can now use routing rules to set response headers or rewrite requests to internal paths, including apps built with FastAPI, Django…
Vercel now supports routing rules for Python projects, including apps built with FastAPI, Django, and Flask. Rules can set response headers or rewrite requests to internal paths, and the Vercel CDN evaluates them before requests reach the application, so a published rule applies without a new deployment.
Rewrites can be created and published from the CDN tab in the project dashboard, from the Vercel CLI, or from Python via the vercel SDK, which wraps the Vercel REST API. Published rules take effect immediately across all regions, and previous versions can be restored from the History tab. Rewrites can also still be defined in vercel.json, but project-level rules are evaluated first, so a published rule takes precedence over a vercel.json rewrite for the same path.
Read the announcement for setup examples, and update the Vercel CLI to the latest version to get started.
