05/06 Phase 2: fixed error 500 Internal Server Error 2

This commit is contained in:
2026-05-06 17:51:10 -04:00
parent d5847108db
commit 5b26836399
2 changed files with 16 additions and 6 deletions
+7 -2
View File
@@ -13,10 +13,15 @@ logger = logging.getLogger(__name__)
def create_admin_app(config_override=None): def create_admin_app(config_override=None):
import os as _os
# Resolve paths relative to this file to avoid CWD-dependent behaviour.
# app/admin/__init__.py → ../../templates = <project_root>/templates
_here = _os.path.dirname(_os.path.abspath(__file__))
_root = _os.path.normpath(_os.path.join(_here, "..", ".."))
flask_app = Flask( flask_app = Flask(
__name__, __name__,
template_folder="../templates", template_folder=_os.path.join(_root, "templates"),
static_folder="../static/admin", static_folder=_os.path.join(_root, "static", "admin"),
static_url_path="/static", static_url_path="/static",
) )
+7 -2
View File
@@ -18,10 +18,15 @@ logger = logging.getLogger(__name__)
def create_tenant_app(config_override=None): def create_tenant_app(config_override=None):
import os as _os
# Resolve paths relative to this file to avoid CWD-dependent behaviour.
# app/tenant/__init__.py → ../../templates = <project_root>/templates
_here = _os.path.dirname(_os.path.abspath(__file__))
_root = _os.path.normpath(_os.path.join(_here, "..", ".."))
flask_app = Flask( flask_app = Flask(
__name__, __name__,
template_folder="../templates", template_folder=_os.path.join(_root, "templates"),
static_folder="../static/tenant", static_folder=_os.path.join(_root, "static", "tenant"),
static_url_path="/static", static_url_path="/static",
) )