Browse Source

fix(perm): set MPLCONFIGDIR to backend/temp to avoid permission issues and updated gitignore

unknown 11 hours ago
parent
commit
4e79c9dee2
2 changed files with 4 additions and 0 deletions
  1. 1 0
      .gitignore
  2. 3 0
      backend/main.py

+ 1 - 0
.gitignore

@@ -27,6 +27,7 @@ __pycache__/
 *$py.class
 .pytest_cache/
 backend/uploads/
+backend/temp/
 backend/cert.p12
 *.target
 *.log

+ 3 - 0
backend/main.py

@@ -1,3 +1,6 @@
+import os
+# Fix matplotlib/gunicorn permission issues in server environment
+os.environ['MPLCONFIGDIR'] = os.path.join(os.getcwd(), 'temp')
 from fastapi import FastAPI, HTTPException, Request, WebSocket, WebSocketDisconnect, Query
 from fastapi.staticfiles import StaticFiles
 from fastapi.middleware.cors import CORSMiddleware