Initial commit
This commit is contained in:
commit
b22231c8b6
40 changed files with 2443 additions and 0 deletions
32
backend/config.py
Normal file
32
backend/config.py
Normal 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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue