# Database credentials DB_HOST=localhost DB_PORT=5432 DB_USER=admin DB_PASSWORD=my_strong_db_password GMAIL_USER=you@gmail.com GMAIL_APP_PASSWORD=abcd efgh ijkl mnop ⚠️ Never commit .env to version control (add it to .gitignore ). 2. Setting Up a Database Password in .env For PostgreSQL, MySQL, or similar: DB_PASSWORD=YourComplexP@ssw0rd! Access in code (Python example):
Since storing a database password and a Gmail password in the same .env is common for apps that log data to a DB and send emails via Gmail, this guide covers both securely. 1. Understanding the .env File An .env (environment variables) file is a plain text file used to store configuration settings, including sensitive credentials like passwords, API keys, and secrets.

