Skip to content

Commit 245535f

Browse files
use an unused config var name
because config vars are currently tenant-scoped, DATABASE_URL from another sample could override the interpolated value in our compose file.
1 parent 880e4be commit 245535f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

samples/fastapi-postgres/compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ services:
99
target: 8000
1010
published: 8000
1111
environment:
12-
- DATABASE_URL=postgres://postgres:${POSTGRES_PASSWORD}@db:5432/postgres
12+
- DB_URL=postgres://postgres:${POSTGRES_PASSWORD}@db:5432/postgres
1313
depends_on:
1414
- db
1515
#deploy:

samples/fastapi-postgres/fastapi/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
from databases import Database
99
from dotenv import load_dotenv
1010

11-
load_dotenv()
11+
load_dotenv()
1212

13-
database_url = os.getenv("DATABASE_URL")
13+
database_url = os.getenv("DB_URL")
1414
print(f"Connecting to database at: {database_url}")
1515
database = Database(database_url)
1616

0 commit comments

Comments
 (0)