Documenting environment variables with .env.example

.env.example documents required variables · ops.env_example

Why it matters

When .env is ignored and nothing documents it, nobody new can start the project without asking.

How to fix it

What to do: Create .env.example documenting all environment variables.

# Database
DATABASE_URL=postgresql://user:password@localhost:5432/dbname

# Security
SECRET_KEY=your-secret-key-change-in-production
DEBUG=false
ALLOWED_HOSTS=localhost,127.0.0.1

# Cache
REDIS_URL=redis://localhost:6379/0

# External services
STRIPE_SECRET_KEY=sk_test_...
SENTRY_DSN=https://...


Key rule: .env.example goes in git, .env goes in .gitignore.

Does your repository pass this check?

Free for public GitHub repositories, no account needed. 50+ DevOps and security checks in about ten seconds.

Related checks