Skip to content

Fix dashboard /web Internal Server Error by resolving templates directory to absolute path#117

Merged
podcctv merged 1 commit into
mainfrom
codex/fix-internal-server-error-on-dashboard
Apr 4, 2026
Merged

Fix dashboard /web Internal Server Error by resolving templates directory to absolute path#117
podcctv merged 1 commit into
mainfrom
codex/fix-internal-server-error-on-dashboard

Conversation

@podcctv

@podcctv podcctv commented Apr 4, 2026

Copy link
Copy Markdown
Owner

Motivation

  • The dashboard router used a relative template directory which could cause TemplateNotFound (Internal Server Error) when the process CWD was not master-api, so templates must be loaded via a stable absolute path.

Description

  • Change templates = Jinja2Templates(directory="static") to compute an absolute path with _STATIC_DIR = Path(__file__).resolve().parents[2] / "static" and initialize Jinja2Templates(directory=str(_STATIC_DIR)) in master-api/app/core/globals.py so template loading is independent of process working directory.

Testing

  • Ran python -m py_compile master-api/app/core/globals.py which succeeded without syntax errors.
  • Verified the resolved static path with PYTHONPATH=master-api python - <<'PY' ... which printed the _STATIC_DIR and confirmed it exists().

Codex Task

@podcctv podcctv merged commit 7ac5bbb into main Apr 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant