From 2395bc215d8a7289687c817bf9433256131fec8a Mon Sep 17 00:00:00 2001 From: Paul Mathieu Date: Mon, 3 Jul 2023 16:56:58 +0200 Subject: [PATCH] Backend LGTM --- Dockerfile | 4 +++- README.md | 4 ++-- backend/zetikettes/zetikettes/settings.py | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2a0d94d..6260547 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ FROM alpine RUN apk --no-cache add python3 inkscape bash imagemagick ttf-opensans +RUN apk --no-cache add py3-pip && pip3 install django tzdata ADD backend /root/zetikettes @@ -8,6 +9,7 @@ RUN mkdir -p /usr/share/fonts/TTF \ && cp /root/zetikettes/fonts/*.ttf /usr/share/fonts/TTF/ \ && fc-cache -fv + # the script will look for templates in /data WORKDIR /root/zetikettes -CMD /usr/bin/python3 web.py +CMD /usr/bin/python3 zetikettes/manage.py runserver 0.0.0.0:8000 diff --git a/README.md b/README.md index 3308502..10d3d1e 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Test ---- ``` -docker run --rm -it -v $PWD/templates:/data zetikettes /bin/bash /root/zetikettes/mkjam.sh +docker run --rm -it -v $PWD/templates:/data zetikettes /bin/bash /root/zetikettes/old/mkjam.sh ``` This should produce a .pdf in `templates/`. Open it to check that @@ -37,7 +37,7 @@ docker run -d --rm -p 127.0.0.1:8000:8000 -v /var/lib/zetikettes/templates:/data Change available templates -------------------------- -1. go to /zetikettes/newtikette.html or konami code from main app +1. go to /zetikettes/admin 1. add the newtikette 1. still no need to restart the container (magic!) 2. profit. diff --git a/backend/zetikettes/zetikettes/settings.py b/backend/zetikettes/zetikettes/settings.py index 12fee74..73a4063 100644 --- a/backend/zetikettes/zetikettes/settings.py +++ b/backend/zetikettes/zetikettes/settings.py @@ -81,7 +81,7 @@ WSGI_APPLICATION = 'zetikettes.wsgi.application' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': BASE_DIR / 'db.sqlite3', + 'NAME': TIKETTE_OUT_DIR / 'db.sqlite3', } }