This guide covers deploying both frontend and backend for FREE.
Free Tier Includes:
- 0.5 GB RAM
- Free PostgreSQL database (500 MB)
- SSL/HTTPS included
- GitHub integration
Steps:
-
Create Render Account
- Go to render.com
- Sign up with GitHub
-
Create New Web Service
- Click "New +" → "Web Service"
- Connect your GitHub repository
- Name:
coshop-backend - Runtime:
Python 3.11 - Build Command:
pip install -r requirements.txt && python manage.py collectstatic --noinput - Start Command:
gunicorn backend.wsgi
-
Add Environment Variables
- Go to "Environment"
- Add these variables:
DEBUG=False SECRET_KEY=your-very-secret-key-here-generate-a-random-string ALLOWED_HOSTS=coshop-backend.onrender.com DATABASE_URL=postgresql://... (will be provided by Render) CORS_ORIGINS=https://your-frontend-domain.vercel.app
-
Connect Database
- Render auto-creates a PostgreSQL database
- DATABASE_URL is auto-added to environment
-
Deploy
- Push to GitHub
- Render auto-deploys
Your Backend URL: https://coshop-backend.onrender.com
Free Tier Includes:
- Unlimited deployments
- Automatic HTTPS
- Global CDN
- GitHub integration
Steps:
-
Deploy with Vercel
npm install -g vercel cd frontend vercelOr use GitHub integration at vercel.com
-
Configure Environment Variables
- Go to Project Settings → Environment Variables
- Add:
REACT_APP_API_URL=https://coshop-backend.onrender.com
-
Update Frontend Code
- In
frontend/src/store.jsor API config, update API base URL:
const API_URL = process.env.REACT_APP_API_URL || 'http://localhost:8000';
- In
-
Deploy
vercel --prod
Your Frontend URL: https://coshop.vercel.app (or your custom domain)
- Automatically provisioned with free web service
- 500 MB free storage
- Automatically backed up
# After deploying backend to Render
curl https://coshop-backend.onrender.com/api/products/
# First request will run migrations automatically via build scriptUpdate your backend ALLOWED_HOSTS and CORS_ORIGINS:
Backend (.env on Render):
ALLOWED_HOSTS=coshop-backend.onrender.com
CORS_ORIGINS=https://coshop.vercel.app
Frontend (.env on Vercel):
REACT_APP_API_URL=https://coshop-backend.onrender.com
- Free tier: $5/month credit
- Easy GitHub deployment
- PostgreSQL included
- Free tier includes services
- PostgreSQL available
- Global deployment
- Free tier: basic web app
- Limited features but completely free
- Free tier: unlimited sites
- Great for static builds
| Service | Free Tier | Cost |
|---|---|---|
| Render Backend | 0.5GB RAM, PostgreSQL | FREE |
| Vercel Frontend | Unlimited deployments | FREE |
| Custom Domain | No (or $12/yr) | FREE |
| Total Monthly | $0 |
- Generate a strong
SECRET_KEY - Set
DEBUG=False - Configure
ALLOWED_HOSTS - Set
CORS_ORIGINScorrectly - Test locally with
.envfile - Commit all changes to GitHub
- Update API URLs in frontend
- Test login/register
- Test product listing
- Test creating orders
- Monitor logs for errors
- Set up backups for database
Access to XMLHttpRequest blocked by CORS policy
Solution: Update CORS_ORIGINS in backend .env to match your frontend URL
psycopg2.OperationalError: could not connect to server
Solution: Check DATABASE_URL in environment variables
GET /static/css/main.css 404
Solution: Run python manage.py collectstatic in build script
Error in console: API not responding
Solution:
- Check
REACT_APP_API_URLenv variable - Verify backend is running
- Check CORS configuration
SECRET_KEY=generate-random-string-min-50-chars
DEBUG=False
ALLOWED_HOSTS=coshop-backend.onrender.com,localhost
DATABASE_URL=postgresql://user:pass@host:5432/db
CORS_ORIGINS=https://coshop.vercel.app,http://localhost:3000
REACT_APP_API_URL=https://coshop-backend.onrender.com
- Dashboard → Your Service → Logs tab
- Real-time error tracking
- Dashboard → Your Project → Deployments
- Live function logs
- Push code to GitHub
- Create Render account & deploy backend
- Create Vercel account & deploy frontend
- Update environment variables
- Test full workflow
- Share your live app! 🎉
Need Help?
- Render Docs: https://render.com/docs
- Vercel Docs: https://vercel.com/docs
- Django Deployment: https://docs.djangoproject.com/en/5.0/howto/deployment/