-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
116 lines (100 loc) · 5.19 KB
/
.env.example
File metadata and controls
116 lines (100 loc) · 5.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# =============================================================================
# PORTFOLIO CONFIGURATION (.env.example)
# Copy this file to .env and customize. Values below are safe defaults for local dev.
# =============================================================================
# -----------------------------------------------------------------------------
# Core
# -----------------------------------------------------------------------------
PROJECT_NAME=Mi Portfolio
SECRET_KEY=your-secret-key-here-generate-a-new-one
DEBUG=True
# Select settings module per environment:
# config.settings.development (local dev)
# config.settings.staging (staging with ALB/nginx container)
# config.settings.production (production with ALB/nginx container or direct)
DJANGO_SETTINGS_MODULE=config.settings.development
# Docker Compose Profile (controls which services are started):
# "direct" - Native nginx on host with Certbot (EC2 direct, no ALB)
# Exposes Gunicorn on :8000 for native nginx proxy
# Cost-effective: ~$10/month (EC2 only)
# "staging" - Nginx container with ALB (AWS staging environment)
# Nginx handles routing, ALB handles SSL with ACM
# Cost: ~$25-35/month (EC2 + ALB)
# "prod" - Same as staging but for production
# Use: docker compose --profile direct up -d
# -----------------------------------------------------------------------------
# Domains
# -----------------------------------------------------------------------------
DOMAIN=localhost
STAGING_DOMAIN=staging.yourdomain.com
PRODUCTION_DOMAIN=yourdomain.com
ALLOWED_HOSTS_DEV=localhost,127.0.0.1,0.0.0.0
ALLOWED_HOSTS_STAGING=staging.yourdomain.com,localhost,127.0.0.1
ALLOWED_HOSTS_PROD=yourdomain.com,www.yourdomain.com
CSRF_TRUSTED_ORIGINS_DEV=http://localhost:3000,http://localhost:8080
CSRF_TRUSTED_ORIGINS_STAGING=https://staging-api.yourdomain.com
CSRF_TRUSTED_ORIGINS_PROD=https://api.yourdomain.com,https://admin.yourdomain.com
# -----------------------------------------------------------------------------
# Database (PostgreSQL recommended for staging/prod)
# -----------------------------------------------------------------------------
# Example (RDS/Local): DATABASE_URL=postgres://user:password@host:5432/dbname
# Default for Docker Compose (service "db"):
DATABASE_URL=postgres://portfolio:portfolio@db:5432/portfolio
# If you prefer SQLite for local dev, uncomment the next line and comment the Postgres URL above:
# DATABASE_URL=sqlite:///db_development.sqlite3
DB_CONN_MAX_AGE=600 # seconds
DB_SSL_REQUIRED=False # True if your Postgres requires SSL (e.g., RDS)
# -----------------------------------------------------------------------------
# Redis (cache, sessions, rate limiting)
# -----------------------------------------------------------------------------
# Default for Docker Compose (service name: redis)
# For external Redis: redis://default:password@redis-host:6379/0
REDIS_URL=redis://redis:6379/0
REDIS_KEY_PREFIX=portfolio
USE_CACHE_SESSIONS=True # Use Redis-backed sessions when REDIS_URL is set
# -----------------------------------------------------------------------------
# Email
# -----------------------------------------------------------------------------
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USE_TLS=True
EMAIL_HOST_USER=your-email@gmail.com
EMAIL_HOST_PASSWORD=your-16-character-app-password
# DEFAULT_FROM_EMAIL=your-email@gmail.com # If omitted, EMAIL_HOST_USER is used
# Send confirmation email to user when the contact form is submitted
SEND_CONTACT_CONFIRMATIONS=True
# Gmail (App Password) example:
# EMAIL_HOST=smtp.gmail.com
# EMAIL_PORT=587
# EMAIL_USE_TLS=True
# EMAIL_HOST_USER=your-email@gmail.com
# EMAIL_HOST_PASSWORD=your-16-character-app-password
# -----------------------------------------------------------------------------
# Security
# -----------------------------------------------------------------------------
SESSION_COOKIE_AGE_DEV=604800 # 1 week (development)
SESSION_COOKIE_AGE_STAGING=43200 # 12 hours (staging)
SESSION_COOKIE_AGE_PROD=86400 # 24 hours (production)
# -----------------------------------------------------------------------------
# SSL Configuration (Staging/Production)
# -----------------------------------------------------------------------------
# Enable SSL redirects and secure cookies
# Set to False when using IP addresses or localhost (prevents SSL redirect errors)
# staging.py automatically detects IP addresses and disables SSL by default
ENABLE_SSL=False
# -----------------------------------------------------------------------------
# Analytics (optional)
# -----------------------------------------------------------------------------
GOOGLE_ANALYTICS_ID=
GOOGLE_TAG_MANAGER_ID=
# -----------------------------------------------------------------------------
# Upload limits (MB)
# -----------------------------------------------------------------------------
MAX_IMAGE_SIZE=5
MAX_DOCUMENT_SIZE=10
# -----------------------------------------------------------------------------
# Translation Service (optional)
# -----------------------------------------------------------------------------
TRANSLATION_PROVIDER=libretranslate
TRANSLATION_API_URL=http://libretranslate:5000
TRANSLATION_API_KEY=