change data location

This commit is contained in:
Alejandro Diaz 2023-09-13 14:07:26 -06:00
parent 5dc5a79f29
commit 933add2211
3 changed files with 4 additions and 4 deletions

View file

@ -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;

View file

@ -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

View file

@ -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}")
return HttpResponse("on" if turn_on else f"Turn on {led}")