Overview
This guide covers the complete installation process for Relaciona, including all dependencies, database setup, cloud storage configuration, and environment variables.Looking for a quick start? See the Quickstart Guide to get up and running in minutes.
System Requirements
Python
Version 3.11+ requiredCheck version:
python3 --versionPostgreSQL
Version 12+ recommendedAlternative: SQLite for local dev only
Git
For cloning the repositoryCheck version:
git --versionNode.js (Optional)
Only if customizing frontendUsed for Tailwind CSS compilation
Step 1: Python Installation
macOS
Linux (Ubuntu/Debian)
Windows
- Download Python 3.11+ from python.org
- Run installer and check “Add Python to PATH”
- Verify:
python --version
Step 2: PostgreSQL Setup
Relaciona uses PostgreSQL for production. SQLite can be used for local testing but is not recommended for production.Install PostgreSQL
Create Database
Step 3: Clone and Setup Project
Clone Repository
Create Virtual Environment
(venv) indicating the virtual environment is active.
Install Dependencies
- Django 4.2.27 - Web framework
- psycopg2-binary - PostgreSQL database adapter
- django-cloudinary-storage - Cloud image storage
- whitenoise - Static file serving
- gunicorn - WSGI HTTP server for production
- python-dotenv - Environment variable management
- dj-database-url - Database URL parser
Step 4: Cloudinary Configuration
Relaciona uses Cloudinary to store student profile pictures. This is required for profile picture uploads.Create Cloudinary Account
- Sign up for free at cloudinary.com
- Navigate to your Dashboard
- Copy your credentials:
- Cloud Name
- API Key
- API Secret
Configure Cloudinary
Add these to your.env file (created in next step):
Cloudinary’s free tier includes 25 GB storage and 25 GB monthly bandwidth - more than enough for most classrooms!
Step 5: Environment Variables
Create a.env file in the project root (same directory as manage.py):
Development Configuration
Add the following to your.env file:
.env
Generate SECRET_KEY
Generate a secure secret key:SECRET_KEY value.
Production Configuration
For production, additional settings are required:.env (Production)
Step 6: Database Migrations
Apply database migrations to create all required tables:- accounts.UserProfile - Student and teacher accounts (see
accounts/models.py:5) - teachers.ClassGroup - Classes with invite codes (see
teachers/models.py:10) - quizzes - VARK and Chapman assessments
- minigames - Game sessions and scores
Step 7: Create Superuser
Create an admin account to access Django admin panel:- Username
- Email (optional)
- Password (entered twice)
/admin/ to manage all data.
Step 8: Collect Static Files
Collect static files for production serving:staticfiles/ directory for WhiteNoise to serve.
In development with
DEBUG=True, Django serves static files automatically. This step is mainly for production.Step 9: Run Development Server
Start the Django development server:- Application: http://localhost:8000
- Admin Panel: http://localhost:8000/admin
Development vs Production
Development Setup
Characteristics
Characteristics
DEBUG=Truein settings- SQLite database option available
- Django serves static files
- Detailed error pages
- Auto-reload on code changes
python manage.py runserver
When to use
When to use
- Local development
- Testing features
- Debugging issues
- Learning the platform
Production Setup
Characteristics
Characteristics
DEBUG=Falsein settings- PostgreSQL database required
- WhiteNoise serves static files
- Generic error pages
- Gunicorn WSGI server
- SSL/HTTPS recommended
When to use
When to use
- Live classroom use
- Multiple simultaneous users
- Data persistence required
- Public internet access
Troubleshooting
Database Connection Errors
Error:django.db.utils.OperationalError: could not connect to server
Solution: Check PostgreSQL is running
Solution: Check PostgreSQL is running
Solution: Verify credentials
Solution: Verify credentials
- Check
.envfile has correctDB_NAME,DB_USER,DB_PASSWORD - Test connection:
Solution: Check database exists
Solution: Check database exists
Cloudinary Upload Errors
Error: Profile pictures fail to uploadVerify Cloudinary credentials
Verify Cloudinary credentials
- Check
.envhas all three Cloudinary variables - Verify credentials at cloudinary.com/console
- Test in Django shell:
Check Cloudinary storage setting
Check Cloudinary storage setting
In
relaciona/settings.py:49, verify:Import Errors
Error:ModuleNotFoundError: No module named 'django'
Virtual environment not activated
Virtual environment not activated
Make sure you see
(venv) in your terminal:Dependencies not installed
Dependencies not installed
Migration Errors
Error:Conflicting migrations detected
Reset migrations (development only)
Reset migrations (development only)
Static Files Not Loading
Error: CSS/JavaScript not loading in productionRun collectstatic
Run collectstatic
Check WhiteNoise configuration
Check WhiteNoise configuration
Verify in
relaciona/settings.py:52-53:Docker Installation (Alternative)
Relaciona includes Docker support for containerized deployment.Using Docker
Dockerfile for the complete configuration.
Using Docker Compose (Coming Soon)
Adocker-compose.yml configuration for running Relaciona with PostgreSQL is planned.
Next Steps
Environment Variables
Complete reference for all configuration options
Database Setup
Advanced database configuration and backup strategies
Cloud Deployment
Deploy to AWS Elastic Beanstalk, Vercel, or Render
Creating Classes
Start using Relaciona with your first class
Having trouble? Check the GitHub Issues or create a new issue with your error details.