From 6daa706e5afeb1a452c1a0e04de68a72718a3698 Mon Sep 17 00:00:00 2001 From: Edwin Eames Date: Mon, 9 Feb 2026 16:26:52 -0500 Subject: [PATCH] fix(crawler): update env and database config Updated crawler configuration and database connection handling. Added .gitignore to exclude pycache and .env file. --- .env | 2 +- .gitignore | 3 +++ database.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.env b/.env index 2f27e69..a01dc2d 100644 --- a/.env +++ b/.env @@ -1 +1 @@ -DATABASE_URL=postgres://postgres:password@192.168.1.204:5432/fuelprices \ No newline at end of file +DATABASE_URL=postgresql://postgres:password@192.168.1.204:5432/fuelprices \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b6cf5f0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +__pycache__/ +*.pyc +.env diff --git a/database.py b/database.py index c42961f..15dd316 100644 --- a/database.py +++ b/database.py @@ -5,7 +5,7 @@ from sqlalchemy.orm import sessionmaker from sqlalchemy.ext.declarative import declarative_base # --- Database Configuration --- -DATABASE_URL = "postgresql://postgres:password@192.168.1.204:5432/fuelprices" +DATABASE_URL = os.getenv("DATABASE_URL", "postgresql://postgres:password@192.168.1.204:5432/fuelprices") # Ensure this DATABASE_URL is correct for your setup (e.g., 'db' for Docker Compose, # 'host.docker.internal' or an IP for external DBs) # For your error, it seems you are trying to connect to 192.164.1.204