Skip to content

Commit

Permalink
Add port configuration to example.
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-chang-dewitt committed May 6, 2021
1 parent 988247c commit 1f348ee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions example/example/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import asyncio
import json
import logging
import os
from uuid import uuid4, UUID
from typing import Any, List
Expand All @@ -10,6 +11,8 @@

from models import AModel, ExtendedModel, ExtendedModelData

logging.basicConfig(level=logging.INFO)


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

conn_params = ConnectionParameters(
host=os.getenv('DB_HOST', 'localhost'),
port=int(os.getenv('DB_PORT', '5432')),
# user=os.getenv('DB_USER', 'postgres'),
# password=os.getenv('DB_PASS', 'postgres'),
# database=os.getenv('DB_NAME', 'postgres'))
Expand Down

0 comments on commit 1f348ee

Please sign in to comment.