add: store template

This commit is contained in:
Toolf
2024-02-05 18:01:57 +02:00
parent 1f92b43879
commit abd6bf0abe
8 changed files with 298 additions and 0 deletions

16
store/config.py Normal file
View File

@@ -0,0 +1,16 @@
import os
def try_parse(type, value: str):
try:
return type(value)
except Exception:
return None
# Configuration for POSTGRES
POSTGRES_HOST = os.environ.get("POSTGRES_HOST") or "localhost"
POSTGRES_PORT = try_parse(int, os.environ.get("POSTGRES_PORT")) or 5432
POSTGRES_USER = os.environ.get("POSTGRES_USER") or "user"
POSTGRES_PASSWORD = os.environ.get("POSTGRES_PASS") or "pass"
POSTGRES_DB = os.environ.get("POSTGRES_DB") or "test_db"