Skip to content

Commit

Permalink
add database connection settings & psycopg library
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchdawson1982 committed Jul 19, 2024
1 parent d9eeb61 commit 8e538a1
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 4 deletions.
12 changes: 10 additions & 2 deletions core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,16 @@

DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": "db.sqlite3",
"ENGINE": (
"django.db.backends.postgresql"
if os.environ.get("RDS_INSTANCE_ADDRESS")
else "django.db.backends.sqlite3"
),
"NAME": os.environ.get("DATABASE_NAME", BASE_DIR / "db.sqlite3"),
"USER": os.environ.get("DATABASE_USERNAME", ""),
"PASSWORD": os.environ.get("DATABASE_PASSWORD", ""),
"HOST": os.environ.get("RDS_INSTANCE_ADDRESS", ""),
"PORT": "5432",
}
}
# Define a service name setting for page titles
Expand Down
28 changes: 26 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ sentry-sdk = { extras = ["django"], version = "^2.5.1" }
ministryofjustice-data-platform-catalogue = { path = "lib/datahub-client", develop = true }
django-azure-auth = "^2.0.0"
django-waffle = "^4.1.0"
psycopg = "^3.2.1"

[tool.poetry.group.dev.dependencies]
black = "^24.4.0"
Expand Down

0 comments on commit 8e538a1

Please sign in to comment.