Fix static folder path resolution for blueprints
Use absolute paths for templates and static folders to ensure they resolve correctly regardless of the working directory. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
24c91b8de7
commit
9070029d31
|
|
@ -1,11 +1,15 @@
|
||||||
"""Web UI blueprint for SmartTools."""
|
"""Web UI blueprint for SmartTools."""
|
||||||
|
|
||||||
|
import os
|
||||||
from flask import Blueprint
|
from flask import Blueprint
|
||||||
|
|
||||||
|
# Use absolute paths for templates and static folders
|
||||||
|
_pkg_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|
||||||
web_bp = Blueprint(
|
web_bp = Blueprint(
|
||||||
"web",
|
"web",
|
||||||
__name__,
|
__name__,
|
||||||
template_folder="templates",
|
template_folder=os.path.join(_pkg_dir, "templates"),
|
||||||
static_folder="static",
|
static_folder=os.path.join(_pkg_dir, "static"),
|
||||||
static_url_path="/static",
|
static_url_path="/static",
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue