From e32ccc0b6ac76f95597c1bce8cc2c26a165a6166 Mon Sep 17 00:00:00 2001 From: Luca Date: Tue, 26 Apr 2022 17:36:08 +0200 Subject: [PATCH] Store 'celerybeat-schedule' in a subdirectory --- .dockerignore | 1 + Dockerfile | 1 + shiftregister/settings.py | 6 ++++-- storage/.gitkeep | 0 4 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 storage/.gitkeep diff --git a/.dockerignore b/.dockerignore index 8032263..58777e3 100644 --- a/.dockerignore +++ b/.dockerignore @@ -6,3 +6,4 @@ README.md db.sqlite3 docker-compose.yml env +storage diff --git a/Dockerfile b/Dockerfile index 4b80b4e..6b319ff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,6 +13,7 @@ COPY requirements.txt ./ RUN pip install --no-cache-dir -r requirements.txt COPY . . +RUN mkdir -p storage EXPOSE 8000 diff --git a/shiftregister/settings.py b/shiftregister/settings.py index d6f29ec..2129361 100644 --- a/shiftregister/settings.py +++ b/shiftregister/settings.py @@ -61,7 +61,7 @@ ROOT_URLCONF = "shiftregister.urls" TEMPLATES = [ { "BACKEND": "django.template.backends.django.DjangoTemplates", - "DIRS": [Path(BASE_DIR, Path("templates"))], + "DIRS": [BASE_DIR / "templates"], "APP_DIRS": True, "OPTIONS": { "context_processors": [ @@ -131,7 +131,7 @@ STATIC_ROOT = "/opt/shiftregister/static" STATIC_URL = "static/" STATICFILES_DIRS = [ - Path(BASE_DIR, Path("assets")), + BASE_DIR / "assets", ] # Default primary key field type @@ -149,3 +149,5 @@ CELERY_BEAT_SCHEDULE = { "schedule": float(getenv("SHIFT_IMPORT_INTERVAL", 60.0)), # seconds }, } + +CELERY_BEAT_SCHEDULE_FILENAME = str(BASE_DIR / "storage" / "celerybeat-schedule") diff --git a/storage/.gitkeep b/storage/.gitkeep new file mode 100644 index 0000000..e69de29