DEV Community

Discussion on: How to deploy a Python/Flask App to Vercel

Collapse
 
zeraye profile image
Jakub Rudnik

You are using flask==2.0.1? Unfortunately vercel don't support it (I think so, I'm not vercel dev).
Quick fix:
requirements.txt

flask==1.1.4
Enter fullscreen mode Exit fullscreen mode

vercel.json

{
  "version": 2,
  "builds": [
    {
      "src": "./index.py",
      "use": "@vercel/python"
    }
  ],
  "routes": [
    {
      "src": "/(.*)",
      "dest": "index.py"
    }
  ]
}
Enter fullscreen mode Exit fullscreen mode
Collapse
 
whiterock profile image
whiterock

Thank you so much for this! I specifically signed up to this website for the sole reason to thank you - this information cannot be found anywhere else and I struggled with Flask 2.0.1 and vercel for hours today.