cookiecutter-django/{{cookiecutter.project_slug}}/bin/post_compile
2020-07-04 15:20:51 +01:00

23 lines
305 B
Bash

#!/usr/bin/env bash
compress_enabled() {
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
python manage.py compress
fi
python manage.py collectstatic --noinput