-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathconfig.py
More file actions
27 lines (23 loc) · 941 Bytes
/
config.py
File metadata and controls
27 lines (23 loc) · 941 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import os
def str_to_bool(value: str | None) -> bool:
if value is None:
return False
return value.lower() in {"true", "1", "t", "yes", "y"}
WTF_CSRF_ENABLED = False
SECRET_KEY = os.environ.get("SECRET_KEY", "aSup3rS33kret")
DB_NAME = os.environ.get("DB_NAME", "postgres")
DB_USER = os.environ.get("DB_USER", "postgres")
DB_PASS = os.environ.get("DB_PASS", "postgres")
DB_SERVICE = os.environ.get("DB_SERVICE", "0.0.0.0")
DB_PORT = os.environ.get("DB_PORT", 5432)
SQLALCHEMY_DATABASE_URI = (
f"postgresql://{DB_USER}:{DB_PASS}@{DB_SERVICE}:{DB_PORT}/{DB_NAME}"
)
DEBUG_TB_INTERCEPT_REDIRECTS = str_to_bool(
os.environ.get("DEBUG_TB_INTERCEPT_REDIRECTS")
)
DEBUG_TB_PROFILER_ENABLED = str_to_bool(os.environ.get("DEBUG_TB_PROFILER_ENABLED"))
SQLALCHEMY_TRACK_MODIFICATIONS = str_to_bool(
os.environ.get("SQLALCHEMY_TRACK_MODIFICATIONS")
)
GOOGLE_ANALYTICS = os.environ.get("GOOGLE_ANALYTICS") # "UA-XXXXXX-XX"