Skip to content

Commit 1f348ee

Browse files
Add port configuration to example.
1 parent 988247c commit 1f348ee

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

example/example/example.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import asyncio
44
import json
5+
import logging
56
import os
67
from uuid import uuid4, UUID
78
from typing import Any, List
@@ -10,6 +11,8 @@
1011

1112
from models import AModel, ExtendedModel, ExtendedModelData
1213

14+
logging.basicConfig(level=logging.INFO)
15+
1316

1417
class UUIDJsonEncoder(json.JSONEncoder):
1518
"""Extended Json Encoder to allow encoding of objects containing UUID."""
@@ -23,6 +26,7 @@ def default(self, obj: Any) -> Any:
2326

2427
conn_params = ConnectionParameters(
2528
host=os.getenv('DB_HOST', 'localhost'),
29+
port=int(os.getenv('DB_PORT', '5432')),
2630
# user=os.getenv('DB_USER', 'postgres'),
2731
# password=os.getenv('DB_PASS', 'postgres'),
2832
# database=os.getenv('DB_NAME', 'postgres'))

0 commit comments

Comments
 (0)