FIX: Windows build crash 'app\static does not exist' (datas absolute + APP_DIR freeze-aware) + VU meter ARM/MIDI keyboard
This commit is contained in:
+4
-1
@@ -58,7 +58,10 @@ app.add_middleware(
|
||||
# Mount storage directory (must come before general /static mount)
|
||||
app.mount("/static/audio", StaticFiles(directory=settings.STORAGE_DIR), name="audio")
|
||||
# Mount app static files (js, css)
|
||||
STATIC_DIR = os.path.join(os.path.dirname(__file__), "static")
|
||||
# Dùng settings.APP_DIR (freeze-aware) thay vì os.path.dirname(__file__):
|
||||
# khi PyInstaller onefile, __file__ trỏ vào thư mục giải nén tạm _MEI...
|
||||
# nhưng static/templates nằm trong sys._MEIPASS/app (config.py đã xử lý).
|
||||
STATIC_DIR = os.path.join(settings.APP_DIR, "static")
|
||||
app.mount("/static", StaticFiles(directory=STATIC_DIR), name="static")
|
||||
|
||||
# Include routers
|
||||
|
||||
Reference in New Issue
Block a user