Skip to 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 and local mode uses .local.env; init-docker.sh or init-local.sh copies it to .env and adds SITE_URL (and, in Docker mode, WEB_PORT, MEDIA_PORT and IMAGE_SUFFIX).

Variable Reference

Core

Variable Type Default Description
DEBUG bool False Enable debug mode
LOG_LEVEL string DEBUG if DEBUG else INFO Root log level. See Logging — boto and urllib3 are pinned to WARNING regardless, so raising this does not leak request bodies.
SECRET_KEY string "change_me" Django secret key
SALT_KEY string "changeme" Encryption salt for Fernet encrypted fields
ALLOWED_HOSTS list ["*"] Comma-separated list of allowed hostnames
ADMIN_URL string "admin/" URL path for the Django admin
SITE_URL string auto-detected Full URL of the site (e.g., https://example.com). init-local.sh and init-docker.sh set it to http://127.0.0.1:<port> in .env.

Database

Variable Type Default Description
DATABASE_URL string "sqlite:///db.sqlite3" Database connection string
CONN_MAX_AGE int 60 Persistent database connection lifetime (seconds, PostgreSQL only)

Cache

Variable Type Default Description
CACHE_URL string "dummycache://" Cache backend connection string

Redis & Celery

Variable Type Default Description
REDIS_URL string None Redis URL for Celery broker, result backend, and Redbeat

Email

EMAIL_PROVIDER selects the sending backend behind django-post_office. See the Email page for full details. Provider credentials default to placeholders so the app boots without them; real keys are required to actually send.

Variable Type Default Description
EMAIL_PROVIDER string "console" Sending backend: console, smtp, ses, mailgun, sendgrid, postmark, resend. Invalid values fail at startup.
EMAIL_URL string "smtp://user:password@localhost:25" SMTP connection string (used when EMAIL_PROVIDER=smtp)
DEFAULT_FROM_EMAIL string "admin@example.com" Default sender address
SERVER_EMAIL string value of DEFAULT_FROM_EMAIL Sender for Django error/admin emails
AWS_SES_ACCESS_KEY_ID string "change_me" AWS SES access key (provider ses)
AWS_SES_SECRET_ACCESS_KEY string "change_me" AWS SES secret key (provider ses)
AWS_SES_REGION_NAME string "eu-central-1" AWS SES region (provider ses)
MAILGUN_API_KEY string "change_me" Mailgun API key (provider mailgun)
MAILGUN_SENDER_DOMAIN string "example.com" Mailgun sender domain (provider mailgun)
MAILGUN_API_URL string "https://api.mailgun.net/v3" Mailgun API base URL; use the EU endpoint for EU accounts
SENDGRID_API_KEY string "change_me" SendGrid API key (provider sendgrid)
POSTMARK_SERVER_TOKEN string "change_me" Postmark server token (provider postmark)
RESEND_API_KEY string "change_me" Resend API key (provider resend)

Static & Media Files

Variable Type Default Description
STATIC_URL string "/static/" URL prefix for static files
STATIC_ROOT string BASE_DIR / "staticfiles" Directory for collected static files
MEDIA_ROOT string BASE_DIR / "media" Directory for uploaded media files. On Appliku, a volume with prefix MEDIA sets this for you.
MEDIA_URL string "/media/" URL prefix for media files. On Appliku, a volume with prefix MEDIA sets this too; an empty value or the literal "None" falls back to the default, and a trailing slash is added.
PRIVATE_MEDIA_ROOT string BASE_DIR / "private-media" Local-disk home for private uploads. Deliberately outside MEDIA_ROOT, which the web server serves.

Object Storage (S3-compatible)

Optional. Local disk is the default — see Media Storage. Requires uv sync --extra s3.

Variable Type Default Description
USE_S3 bool False Move uploaded media to S3-compatible object storage
S3_ACCESS_KEY_ID string "" Access key. Required when USE_S3=True
S3_SECRET_ACCESS_KEY string "" Secret key. Required when USE_S3=True
S3_BUCKET_NAME string "" Bucket name. Required when USE_S3=True
S3_REGION_NAME string "" Region, if your provider uses one
S3_ENDPOINT_URL string "" Provider endpoint. Empty means AWS S3; this is the only setting that selects a provider
S3_CDN_BASE string "" CDN or custom domain used for public URLs
S3_DEFAULT_ACL string "" Object ACL for public files. Empty works everywhere. public-read on DigitalOcean Spaces / Wasabi. Must stay empty on AWS with ACLs disabled and on Cloudflare R2, which reject uploads carrying an ACL
S3_SEND_PRIVATE_ACL bool True Send private ACL on private uploads. Turn off for providers without ACLs
S3_SIGNED_URL_EXPIRE int 600 Lifetime in seconds of signed URLs for private files
S3_ADDRESSING_STYLE string "" Set to path for MinIO and some self-hosted gateways

Authentication & Security

Variable Type Default Description
RECAPTCHA_PUBLIC_KEY string "" Google reCAPTCHA site key
RECAPTCHA_PRIVATE_KEY string "" Google reCAPTCHA secret key
RECAPTCHA_REQUIRED_SCORE float 0.5 Minimum reCAPTCHA score (0.0–1.0)
OTP_TOTP_ISSUER string "uptimefor.me" Name shown in authenticator apps
TOS_LINK string "/" Terms of Service URL
DPA_LINK string "/" Privacy Policy URL

Features

Variable Type Default Description
SPEEDPY_TEAMS_ENABLED bool True Enable/disable teams functionality
SPEEDPY_TOURS_ENABLED bool True Enable/disable onboarding tours
DEMO_MODE bool False Pre-fill login form with demo credentials
DEFAULT_ADMIN_PASSWORD string None Password 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