mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-23 01:57:03 +03:00
fix compresss offline never runs using environ
This commit is contained in:
parent
e1cb30b699
commit
d3db7a867f
|
@ -6,9 +6,24 @@ set -o nounset
|
||||||
|
|
||||||
|
|
||||||
python /app/manage.py collectstatic --noinput
|
python /app/manage.py collectstatic --noinput
|
||||||
{%- if cookiecutter.use_whitenoise == 'y' and cookiecutter.use_compressor == 'y' %}
|
{% if cookiecutter.use_whitenoise == 'y' and cookiecutter.use_compressor == 'y' %}
|
||||||
if [ "${COMPRESS_ENABLED:-}" = "True" ];
|
compress_enabled() {
|
||||||
then
|
python << END
|
||||||
|
import sys
|
||||||
|
|
||||||
|
from environ import Env
|
||||||
|
|
||||||
|
env = Env(COMPRESS_ENABLED=(bool, True))
|
||||||
|
if env('COMPRESS_ENABLED'):
|
||||||
|
sys.exit(0)
|
||||||
|
else:
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
END
|
||||||
|
}
|
||||||
|
|
||||||
|
if compress_enabled; then
|
||||||
|
# NOTE this command will fail if django-compressor is disabled
|
||||||
python /app/manage.py compress
|
python /app/manage.py compress
|
||||||
fi
|
fi
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user