From 092a9ca215bbb14b0df58a2faad88eceec55c642 Mon Sep 17 00:00:00 2001 From: Jessica Millar Date: Sat, 10 Aug 2024 11:27:09 -0400 Subject: [PATCH] Remove db password from git control. PASSWORD NOW CHANGED ALSO --- alembic.ini | 4 ++-- alembic/env.py | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/alembic.ini b/alembic.ini index 9348fd7..991db25 100644 --- a/alembic.ini +++ b/alembic.ini @@ -60,8 +60,8 @@ version_path_separator = os # Use os.pathsep. Default configuration used for ne # are written from script.py.mako # output_encoding = utf-8 -#sqlalchemy.url = driver://user:pass@localhost/dbname -sqlalchemy.url = postgresql://persister:star5fish@journaldb.electricity.works/journaldb +#Overwritten by value in .env via env.py +sqlalchemy.url = dummy_placeholder [post_write_hooks] # post_write_hooks defines scripts or Python functions that are run diff --git a/alembic/env.py b/alembic/env.py index feda804..ba80d88 100644 --- a/alembic/env.py +++ b/alembic/env.py @@ -10,10 +10,11 @@ # Add the URL import dotenv -from gjk.config import Settings +import os +dotenv.load_dotenv() -settings = Settings(_env_file=dotenv.find_dotenv()) -config.set_main_option("sqlalchemy.url", settings.db_url.get_secret_value()) +DATABASE_URL = os.getenv("GJK_DB_URL") +config.set_main_option("sqlalchemy.url", DATABASE_URL) # Interpret the config file for Python logging. # This line sets up loggers basically.