Upload files to "backend"

This commit is contained in:
Thierry 2026-04-01 21:32:50 +02:00
parent b25bf2151d
commit 26088d26a2
3 changed files with 126 additions and 0 deletions

32
backend/config.py Normal file
View file

@ -0,0 +1,32 @@
import os
from pathlib import Path
# URL Potree - configurée via variable d'environnement POTREE_URL
# Pour le développement local : POTREE_URL=http://localhost:8090
# Pour la production : POTREE_URL=http://potree_server:8090
def load_potree_config():
"""Charge la configuration Potree depuis les variables d'environnement."""
return os.getenv(
"POTREE_URL", "http://localhost:8090"
).strip().rstrip("/")
def get_entwine_path():
"""Retourne le chemin de entwine ou None si non trouvé"""
path = os.getenv("ENTWINE_PATH")
if path:
return path.strip()
return None
BASE_DIR = Path(__file__).resolve().parent
DATA_DIR = BASE_DIR / "data"
UPLOADS_DIR = DATA_DIR / "uploads"
EPT_DIR = DATA_DIR / "ept" # était POTREE_DIR
UPLOADS_DIR.mkdir(parents=True, exist_ok=True)
EPT_DIR.mkdir(parents=True, exist_ok=True)
SUPPORTED_FORMATS = [".las", ".laz", ".ply", ".xyz", ".pts"]
POTREE_URL = load_potree_config()
ENTWINE_PATH = get_entwine_path()