Fixed collectstatic if the now possible static files in DATA_DIR do not

exist, also, we have to run collectstatic at startup time
This commit is contained in:
Raphael Michel
2015-06-29 17:24:51 +02:00
parent 0a5c2c9fcf
commit cfb8b24b4a
2 changed files with 8 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ cd /pretix/src
export DJANGO_SETTINGS_MODULE=pretix.settings export DJANGO_SETTINGS_MODULE=pretix.settings
export DATA_DIR=/data/ export DATA_DIR=/data/
python3 manage.py migrate python3 manage.py migrate
python3 manage.py collectstatic --noinput
python3 manage.py compress python3 manage.py compress
gunicorn \ gunicorn \
-b '0.0.0.0:80' \ -b '0.0.0.0:80' \

View File

@@ -186,10 +186,13 @@ STATICFILES_FINDERS = (
'compressor.finders.CompressorFinder', 'compressor.finders.CompressorFinder',
) )
STATICFILES_DIRS = ( STATICFILES_DIRS = []
os.path.join(DATA_DIR, 'static'),
os.path.join(BASE_DIR, 'static'), 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 = ( COMPRESS_PRECOMPILERS = (
('text/less', 'pretix.helpers.lessabsolutefilter.LessFilter'), ('text/less', 'pretix.helpers.lessabsolutefilter.LessFilter'),