Better — .env.python.local
# You're designing the new dashboard locally ENABLE_NEW_DASHBOARD=true PAYMENT_PROVIDER=stripe_sandbox LOG_LEVEL=debug PyCharm, VSCode, or debugpy often require environment variables. Keep your personal debug port in .env.python.local :
# .gitignore .env .env.python .env.python.local *.local Wait—why ignore .env as well? Because for maximum security, you should actually commit a .env.example file instead of the real .env . But if you choose to commit a safe .env (without secrets), then only ignore *.local . Let's look at concrete examples where this pattern saves the day. 1. Switching Between SQLite and Postgres Locally .env (committed): .env.python.local
ENABLE_NEW_DASHBOARD=false PAYMENT_PROVIDER=stripe_live .env.python.local