From cfb8b24b4a4bd01e96467271eb7f0fa60ac33d59 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Mon, 29 Jun 2015 17:24:51 +0200 Subject: [PATCH] Fixed collectstatic if the now possible static files in DATA_DIR do not exist, also, we have to run collectstatic at startup time --- deployment/docker/standalone/gunicorn_starter.bash | 1 + src/pretix/settings.py | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/deployment/docker/standalone/gunicorn_starter.bash b/deployment/docker/standalone/gunicorn_starter.bash index 950dad8a49..95c79d45ae 100644 --- a/deployment/docker/standalone/gunicorn_starter.bash +++ b/deployment/docker/standalone/gunicorn_starter.bash @@ -3,6 +3,7 @@ cd /pretix/src export DJANGO_SETTINGS_MODULE=pretix.settings export DATA_DIR=/data/ python3 manage.py migrate +python3 manage.py collectstatic --noinput python3 manage.py compress gunicorn \ -b '0.0.0.0:80' \ diff --git a/src/pretix/settings.py b/src/pretix/settings.py index b90ecfeeb4..2a2b1f5fc8 100644 --- a/src/pretix/settings.py +++ b/src/pretix/settings.py @@ -186,10 +186,13 @@ STATICFILES_FINDERS = ( 'compressor.finders.CompressorFinder', ) -STATICFILES_DIRS = ( - os.path.join(DATA_DIR, 'static'), - os.path.join(BASE_DIR, 'static'), -) +STATICFILES_DIRS = [] + +if os.path.exists(os.path.join(DATA_DIR, 'static')): + STATICFILES_DIRS.append(os.path.join(DATA_DIR, 'static')) + +if os.path.exists(os.path.join(BASE_DIR, 'static')): + STATICFILES_DIRS.append(os.path.join(BASE_DIR, 'static')) COMPRESS_PRECOMPILERS = ( ('text/less', 'pretix.helpers.lessabsolutefilter.LessFilter'),