I am trying to deploy a DRF Api on vercel, I tried upgrading setuptools and everything that I found on net but still not able to get it to work
I am using python3.10.13
vercel.json
{
"builds": [{
"src": "./core/wsgi.py",
"use": "@vercel/python",
"config": { "maxLambdaSize": "15mb", "runtime": "python3.10" }
},
{
"src": "./build_files.sh",
"use": "@vercel/static-build",
"config": { "distDir": "staticfiles_build" }
}],
"routes": [
{
"src": "/static/(.*)",
"dest": "/static/$1"
},
{
"src": "/(.*)",
"dest": "./core/wsgi.py"
}
]
}
build_files.sh
#!/bin/bash
echo "BUILD START"
# Activate virtual environment if needed
# Replace 'venv' with your virtual environment directory name
source env/bin/activate
# Install dependencies
python3 -m pip install -r requirements.txt
# Collect static files
python3 manage.py collectstatic --noinput --clear
echo "BUILD END"
I was trying to follow this article for deployment article
please guide me on this. I am trying for last 2 days but not able to solve it
New contributor
ETC_Suyog Mahajan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.