change data location
This commit is contained in:
parent
5dc5a79f29
commit
933add2211
|
@ -11,7 +11,7 @@
|
||||||
default = true;
|
default = true;
|
||||||
|
|
||||||
locations = {
|
locations = {
|
||||||
"/static/".alias = "/tmp/static/";
|
"/static/".alias = "/run/nginx/static/";
|
||||||
|
|
||||||
"/".extraConfig = ''
|
"/".extraConfig = ''
|
||||||
uwsgi_pass unix://${config.services.uwsgi.runDir}/uwsgi.sock;
|
uwsgi_pass unix://${config.services.uwsgi.runDir}/uwsgi.sock;
|
||||||
|
|
|
@ -14,7 +14,7 @@ from pathlib import Path
|
||||||
|
|
||||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
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
|
# Quick-start development settings - unsuitable for production
|
||||||
|
|
|
@ -26,7 +26,7 @@ def home(request):
|
||||||
|
|
||||||
|
|
||||||
def take_photo(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")
|
return HttpResponse("Ok")
|
||||||
|
|
||||||
|
|
||||||
|
@ -56,4 +56,4 @@ def toggle_led(led, turn_on):
|
||||||
else:
|
else:
|
||||||
pin_control.turn_on_pin(gpio_pin)
|
pin_control.turn_on_pin(gpio_pin)
|
||||||
leds_state[led] = not turn_on
|
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}")
|
Loading…
Reference in a new issue