compress after collecting static files

This commit is contained in:
Niklas rust 2019-10-22 14:16:24 +02:00
parent 1454b26b34
commit b9fe93ed7a
3 changed files with 7 additions and 2 deletions

View File

@ -5,6 +5,6 @@ set -o pipefail
set -o nounset
python /app/manage.py compress
python /app/manage.py collectstatic --noinput
python /app/manage.py compress
/usr/local/bin/gunicorn config.wsgi --bind 0.0.0.0:5000 --chdir=/app

View File

@ -142,7 +142,7 @@ STATIC_ROOT = str(ROOT_DIR("staticfiles"))
STATIC_URL = "/static/"
# https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#std:setting-STATICFILES_DIRS
STATICFILES_DIRS = [str(APPS_DIR.path("static"))]
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage'
STATICFILES_STORAGE = 'schickmacher.storage.WhiteNoiseStaticFilesStorage'
# https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#staticfiles-finders
STATICFILES_FINDERS = [

5
schickmacher/storage.py Normal file
View File

@ -0,0 +1,5 @@
from whitenoise.storage import CompressedManifestStaticFilesStorage
class WhiteNoiseStaticFilesStorage(CompressedManifestStaticFilesStorage):
manifest_strict = False