Description
SQLite is great for development but not production. Migrate the database connection to PostgreSQL, with the URL read from an environment variable.
What to do
Acceptance Criteria
- The app runs with a PostgreSQL database when
DATABASE_URL is set
- Falls back gracefully or raises a clear error if
DATABASE_URL is missing
.env is in .gitignore and never committed
.env.example is committed and documents required variables
Docker one-liner for reviewers:
docker run --name devboard-pg -e POSTGRES_PASSWORD=password -e POSTGRES_DB=devboard -p 5432:5432 -d postgres
Difficulty
🟡 Intermediate
Description
SQLite is great for development but not production. Migrate the database connection to PostgreSQL, with the URL read from an environment variable.
What to do
pip install psycopg2-binary python-dotenvto dependencies.envfile (and add it to.gitignore):DATABASE_URL=postgresql://user:password@localhost/devboarddatabase.pyto readDATABASE_URLfrom the environment usingos.getenvorpython-dotenv.env.examplefile with placeholder values for other contributorsAcceptance Criteria
DATABASE_URLis setDATABASE_URLis missing.envis in.gitignoreand never committed.env.exampleis committed and documents required variablesDocker one-liner for reviewers:
Difficulty
🟡 Intermediate