From 6108c6f07622682b8a5aacb6d6a3c6d6fc0b23b3 Mon Sep 17 00:00:00 2001 From: audax Date: Thu, 12 Sep 2019 21:33:13 +0200 Subject: [PATCH] Run django-compress in offline mode Required to use both whitenoise and compress with precompile steps --- .envs/.production/.django | 2 +- compose/production/django/start | 1 + config/settings/production.py | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.envs/.production/.django b/.envs/.production/.django index 6eb8235..4c04311 100644 --- a/.envs/.production/.django +++ b/.envs/.production/.django @@ -23,7 +23,7 @@ DJANGO_ACCOUNT_ALLOW_REGISTRATION=True # django-compressor # ------------------------------------------------------------------------------ -COMPRESS_ENABLED= +COMPRESS_ENABLED=True # Gunicorn # ------------------------------------------------------------------------------ diff --git a/compose/production/django/start b/compose/production/django/start index 0ad39df..80e9786 100644 --- a/compose/production/django/start +++ b/compose/production/django/start @@ -5,5 +5,6 @@ set -o pipefail set -o nounset +python /app/manage.py compress python /app/manage.py collectstatic --noinput /usr/local/bin/gunicorn config.wsgi --bind 0.0.0.0:5000 --chdir=/app diff --git a/config/settings/production.py b/config/settings/production.py index 2d5bfd0..23eb172 100644 --- a/config/settings/production.py +++ b/config/settings/production.py @@ -108,6 +108,7 @@ COMPRESS_ENABLED = env.bool("COMPRESS_ENABLED", default=True) # COMPRESS_STORAGE = "storages.backends.s3boto3.S3Boto3Storage" # https://django-compressor.readthedocs.io/en/latest/settings/#django.conf.settings.COMPRESS_URL COMPRESS_URL = STATIC_URL # noqa F405 +COMPRESS_OFFLINE = True # Collectfast # ------------------------------------------------------------------------------ # https://github.com/antonagestam/collectfast#installation