diff --git a/.gitignore b/.gitignore index d8ecbd6..9e32054 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +.idea/ + __pycache__ .venv diff --git a/nupes-elections-front/src/Elections2024.js b/nupes-elections-front/src/Elections2024.js index f8196b3..4072d48 100644 --- a/nupes-elections-front/src/Elections2024.js +++ b/nupes-elections-front/src/Elections2024.js @@ -133,19 +133,19 @@ export default function Election2024({typeResultats = "france"}) { const [dataSieges, setDataSieges] = useState([]) useEffect(() => { - fetch("/nupes/data/resultats/europeennes2024/blocs.json").then(response => response.json()) + fetch("/data/resultats/europeennes2024/blocs.json").then(response => response.json()) .then(data => setBlocs(data)) - fetch("/nupes/data/resultats/europeennes2024/nuances.json").then(response => response.json()) + fetch("/data/resultats/europeennes2024/nuances.json").then(response => response.json()) .then(data => setNuances(data)) - fetch("/nupes/data/resultats/europeennes2024/listes.json").then(response => response.json()) + fetch("/data/resultats/europeennes2024/listes.json").then(response => response.json()) .then(data => setListes(data)) if (typeResultats === "france") { - fetch("/nupes/data/resultats/europeennes2024/france.json").then(response => response.json()) + fetch("/data/resultats/europeennes2024/france.json").then(response => response.json()) .then(data => setResultats(data)) } else { - fetch(`/nupes/data/resultats/europeennes2024/${typeResultats}/${zoneId}.json`).then(response => response.json()) + fetch(`/data/resultats/europeennes2024/${typeResultats}/${zoneId}.json`).then(response => response.json()) .then(data => setResultats(data)) } }, []) diff --git a/nupes/cache.py b/nupes/cache.py index 12c4351..0d6adca 100644 --- a/nupes/cache.py +++ b/nupes/cache.py @@ -3,7 +3,7 @@ from pathlib import Path import requests -CACHE_DIR = Path(__file__).parent / 'cache' +CACHE_DIR = Path(__file__).parent.parent / 'cache' def get_file(url, filename, force_etag: str = ""): diff --git a/nupes/scripts/export_resultats_2024.py b/nupes/scripts/export_resultats_2024.py index 1e26b16..37b2cbc 100644 --- a/nupes/scripts/export_resultats_2024.py +++ b/nupes/scripts/export_resultats_2024.py @@ -9,7 +9,7 @@ from nupes.models.geographie import Region, Departement, Commune from nupes.models.europeennes2024 import Bloc, Nuance, Liste, \ ResultatsFrance, ResultatsRegion, ResultatsDepartement, ResultatsCommune -DATA_DIR = Path(__file__).parent.parent / 'data' +DATA_DIR = Path(__file__).parent.parent.parent / 'data' def exporter_listes(engine: Engine, debug: bool = False) -> None: