Overview
Relaciona supports multiple deployment platforms. This guide covers AWS Elastic Beanstalk, Vercel, Render, and Docker-based deployments.AWS Elastic Beanstalk
Elastic Beanstalk provides easy deployment with Docker support. The free tier is available for eligible accounts.Prerequisites
- AWS account (aws.amazon.com)
- EB CLI installed (optional but recommended)
Deployment Files
Relaciona includes the following EB configuration: Dockerfile:Option 1: Web Console Deployment
Create Application
- Navigate to Elastic Beanstalk in AWS Console
- Click Create Application
- Application name:
relaciona-app - Platform: Docker
- Platform branch: Docker running on 64bit Amazon Linux 2023
- Application code: Upload
relaciona.zip
Configure Environment
- Choose Configuration presets: Single instance (free tier eligible)
- Click Next
Option 2: EB CLI Deployment
Database Setup with RDS
See the Database Setup guide for creating an RDS PostgreSQL instance. Key points:- Use
db.t3.microfor free tier - Enable public access if connecting from outside AWS
- Configure security groups to allow EB → RDS connections
- Set RDS endpoint as
DB_HOSTenvironment variable
Running Migrations on EB
After deployment, SSH into your instance to run migrations:Updates and Redeployment
Vercel Deployment
Vercel provides serverless deployment for Python applications.Configuration
vercel.json:Deployment Steps
Set Environment Variables
In Vercel dashboard:
- Go to Project Settings → Environment Variables
- Add all required variables:
SECRET_KEYDEBUG=False- Database credentials
- Cloudinary credentials
- Set scope: Production, Preview, Development
Vercel Limitations
Production Deployment
Render Deployment
Render provides simple deployment with managed databases.Configuration
render.yaml:Why build.sh includes migrate
Why build.sh includes migrate
Render automatically runs
build.sh on each deployment, making it ideal for running migrations. This ensures your database schema is always up-to-date.Deployment Steps
Create Render Account
Sign up at render.com
Create PostgreSQL Database
- Click New + → PostgreSQL
- Name:
relaciona-db - Plan: Free
- Click Create Database
- Note the Internal Database URL
Create Web Service
- Click New + → Web Service
- Connect your Git repository
- Name:
relaciona-app - Environment: Python 3
- Build Command:
./build.sh - Start Command:
gunicorn relaciona.wsgi:application
Render Features
- Auto-deploy: Pushes to GitHub automatically trigger deployments
- Free SSL: HTTPS enabled by default
- Managed PostgreSQL: Automatic backups on paid plans
- Zero-downtime deploys: On paid plans
Docker Deployment
Deploy using Docker on any platform that supports containers.Build Image
Run Container
Using docker-compose
Createdocker-compose.yml:
Docker Hub Deployment
Static Files Serving
Relaciona uses WhiteNoise for static files, which works out-of-the-box on all platforms:settings.py
Media Files with Cloudinary
All user uploads are stored on Cloudinary, ensuring files persist across deployments:Create Cloudinary Account
Sign up at cloudinary.com
SSL/HTTPS Configuration
AWS Elastic Beanstalk
Use AWS Certificate Manager (ACM) and Application Load Balancer:- Request SSL certificate in ACM
- Configure Load Balancer with HTTPS listener
- Update
settings.py:
Vercel & Render
Automatic HTTPS - no configuration needed!Post-Deployment Checklist
Test Application
- Access homepage
- Test login/registration
- Upload media file (test Cloudinary)
- Access admin panel
Troubleshooting
Static files not loading
Static files not loading
Solution:
- Run
python manage.py collectstatic --no-input - Verify WhiteNoise is in MIDDLEWARE (after SecurityMiddleware)
- Check
STATIC_ROOTandSTATICFILES_STORAGEsettings - Ensure build process includes collectstatic
Database connection errors
Database connection errors
Solution:
- Verify all DB_* environment variables are set correctly
- Check database host is accessible (security groups, firewall)
- Confirm PostgreSQL is running
- Test connection:
python manage.py dbshell - For cloud databases, ensure IP whitelist includes your platform
500 Internal Server Error
500 Internal Server Error
Solution:
- Set
DEBUG=Truetemporarily to see detailed error - Check application logs
- Verify SECRET_KEY is set
- Ensure migrations are up to date
- Check ALLOWED_HOSTS includes your domain
Media uploads failing
Media uploads failing
Solution:
- Verify Cloudinary credentials are correct
- Check CLOUDINARY_* environment variables
- Test Cloudinary connection in Django shell:
- Ensure Cloudinary is in INSTALLED_APPS
CSRF verification failed
CSRF verification failed
Solution:
- Add your domain to
CSRF_TRUSTED_ORIGINS: - For localhost development, ensure domain includes port:
Next Steps
Environment Variables
Reference for all environment variables
Database Setup
PostgreSQL configuration and management
Configuration
Django settings reference