Performance: Environment variables for secrets
MEDIUM IMPACT
This affects page load speed indirectly by reducing server startup delays and preventing blocking caused by secret management errors.
import os SECRET_KEY = os.getenv('DJANGO_SECRET_KEY') DATABASE_PASSWORD = os.getenv('DATABASE_PASSWORD')
SECRET_KEY = 'hardcoded-secret-key' DATABASE_PASSWORD = 'hardcoded-password'
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Hardcoded secrets in code | 0 | 0 | 0 | [X] Bad |
| Environment variables for secrets | 0 | 0 | 0 | [OK] Good |