mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-24 02:24:07 +03:00
31 lines
586 B
Bash
31 lines
586 B
Bash
#!/bin/bash
|
|
|
|
set -o errexit
|
|
set -o pipefail
|
|
set -o nounset
|
|
|
|
|
|
python /app/manage.py collectstatic --noinput
|
|
{% if cookiecutter.use_whitenoise == 'y' and cookiecutter.use_compressor == 'y' %}
|
|
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
|
|
# NOTE this command will fail if django-compressor is disabled
|
|
python /app/manage.py compress
|
|
fi
|
|
{%- endif %}
|
|
/usr/local/bin/gunicorn config.wsgi --bind 0.0.0.0:5000 --chdir=/app
|