Skip to main content

Environment Variables

Overview

SpeedPy uses django-environ for environment variable management. Variables are read from a .env file in the project root.

The Docker setup uses .docker.env as the template (copied to .env during make init).

Variable Reference

Core

VariableTypeDefaultDescription
DEBUGboolFalseEnable debug mode
SECRET_KEYstring"change_me"Django secret key
SALT_KEYstring"changeme"Encryption salt for Fernet encrypted fields
ALLOWED_HOSTSlist["*"]Comma-separated list of allowed hostnames
ADMIN_URLstring"admin/"URL path for the Django admin
SITE_URLstringauto-detectedFull URL of the site (e.g., https://example.com)

Database

VariableTypeDefaultDescription
DATABASE_URLstring"sqlite:///db.sqlite3"Database connection string
CONN_MAX_AGEint60Persistent database connection lifetime (seconds, PostgreSQL only)

Cache

VariableTypeDefaultDescription
CACHE_URLstring"dummycache://"Cache backend connection string

Redis & Celery

VariableTypeDefaultDescription
REDIS_URLstringNoneRedis URL for Celery broker, result backend, and Redbeat

Email

VariableTypeDefaultDescription
EMAIL_URLstring"smtp://user:password@localhost:25"Email backend connection string
DEFAULT_FROM_EMAILstring"admin@example.com"Default sender address
AWS_SES_ACCESS_KEY_IDstring"change_me"AWS SES access key (if using SES)
AWS_SES_SECRET_ACCESS_KEYstring"change_me"AWS SES secret key (if using SES)

Static & Media Files

VariableTypeDefaultDescription
STATIC_URLstring"/static/"URL prefix for static files
STATIC_ROOTstringBASE_DIR / "staticfiles"Directory for collected static files
MEDIA_ROOTstringBASE_DIR / "media"Directory for uploaded media files
MEDIA_PATHstring"/media/"URL prefix for media files

Authentication & Security

VariableTypeDefaultDescription
RECAPTCHA_PUBLIC_KEYstring""Google reCAPTCHA site key
RECAPTCHA_PRIVATE_KEYstring""Google reCAPTCHA secret key
RECAPTCHA_REQUIRED_SCOREfloat0.5Minimum reCAPTCHA score (0.0–1.0)
OTP_TOTP_ISSUERstring"uptimefor.me"Name shown in authenticator apps
TOS_LINKstring"/"Terms of Service URL
DPA_LINKstring"/"Privacy Policy URL

Features

VariableTypeDefaultDescription
SPEEDPY_TEAMS_ENABLEDboolTrueEnable/disable teams functionality
DEMO_MODEboolFalsePre-fill login form with demo credentials
DEFAULT_ADMIN_PASSWORDstringNonePassword for the auto-created superuser

Docker Default Environment

The .docker.env file used by Docker Compose:

DEBUG=True
DATABASE_URL=postgres://speedpycom:speedpycom@db:5432/speedpycom
REDIS_URL=redis://redis:6379/0
SECRET_KEY=changeme