diff --git a/triviOS/web.nix b/triviOS/web.nix index 8bc104e..4e01c6e 100644 --- a/triviOS/web.nix +++ b/triviOS/web.nix @@ -11,7 +11,7 @@ default = true; locations = { - "/static/".alias = "/tmp/static/"; + "/static/".alias = "/run/nginx/static/"; "/".extraConfig = '' uwsgi_pass unix://${config.services.uwsgi.runDir}/uwsgi.sock; diff --git a/ui/homemanager/settings.py b/ui/homemanager/settings.py index e9f95c7..2b82d6f 100644 --- a/ui/homemanager/settings.py +++ b/ui/homemanager/settings.py @@ -14,7 +14,7 @@ from pathlib import Path # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent -DATA_DIR = Path("/tmp").resolve() +DATA_DIR = Path("/run/nginx").resolve() # Quick-start development settings - unsuitable for production diff --git a/ui/main/views.py b/ui/main/views.py index d40eba1..316054f 100644 --- a/ui/main/views.py +++ b/ui/main/views.py @@ -26,7 +26,7 @@ def home(request): def take_photo(request): - pin_control.capture_image(b'/tmp/static/photo.jpg') + pin_control.capture_image(b'/run/nginx/static/photo.jpg') return HttpResponse("Ok") @@ -56,4 +56,4 @@ def toggle_led(led, turn_on): else: pin_control.turn_on_pin(gpio_pin) leds_state[led] = not turn_on - return HttpResponse(f"Turn off {led}" if turn_on else f"Turn on {led}") \ No newline at end of file + return HttpResponse("on" if turn_on else f"Turn on {led}") \ No newline at end of file