Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
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")
Expand All @@ -10,7 +17,11 @@
SQLALCHEMY_DATABASE_URI = (
f"postgresql://{DB_USER}:{DB_PASS}@{DB_SERVICE}:{DB_PORT}/{DB_NAME}"
)
DEBUG_TB_INTERCEPT_REDIRECTS = False
DEBUG_TB_PROFILER_ENABLED = True
SQLALCHEMY_TRACK_MODIFICATIONS = False
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"
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ services:
volumes:
- .:/app
environment:
DEBUG_TB_PROFILER_ENABLED: true
DB_SERVICE: postgres

postgres:
Expand Down