Overview
Relaciona is built with Django 4.2 and uses a configuration system based on environment variables for flexibility across different deployment environments. All configuration is centralized inrelaciona/settings.py.
Core Settings
SECRET_KEY Generation
TheSECRET_KEY is critical for Django’s cryptographic signing. It’s used for session management, password hashing, and CSRF protection.
DEBUG Mode
DEBUG mode controls whether detailed error pages are shown and affects performance optimizations.settings.py
Host Configuration
ALLOWED_HOSTS
Defines which host/domain names this Django site can serve. This is a security measure to prevent HTTP Host header attacks.settings.py
Recommended Production Setup
Recommended Production Setup
Instead of using
'*' (which allows all hosts), specify your exact domains:CSRF_TRUSTED_ORIGINS
Specifies trusted origins for unsafe requests (POST, PUT, DELETE) when using HTTPS.settings.py
Static Files with WhiteNoise
Relaciona uses WhiteNoise to serve static files efficiently in production without requiring a separate web server.Configuration
settings.py
Collecting Static Files
Before deployment, collect all static files intoSTATIC_ROOT:
Media Files with Cloudinary
User-uploaded files (profile pictures, quiz images, etc.) are stored on Cloudinary instead of the local filesystem.Configuration
settings.py
Create Cloudinary Account
Sign up at cloudinary.com for a free account.
Set Environment Variables
Configure the three required environment variables (see Environment Variables).
Security Settings
Relaciona includes SSL/TLS proxy support for deployment behind reverse proxies:settings.py
Enhanced Security for Production
Enhanced Security for Production
For production deployments with proper SSL certificates, consider enabling:
Localization
Relaciona is configured for Spanish (Spain):settings.py
Database Configuration
See Database Setup for detailed PostgreSQL configuration.Next Steps
Environment Variables
Complete list of all environment variables
Database Setup
PostgreSQL installation and configuration
Cloud Deployment
Deploy to AWS, Vercel, or Render