cookiecutter-django/{{cookiecutter.project_slug}}/bin/post_compile
Bruno Alla 2e561ed6c4
Fix missing compilemessages step before deploying to prod (#4363)
* Update readme on internationalization

* Run compilemessages when building production image

* Run compilemessages when deploying to Heroku

* Always keep Heroku post-compile hooks

* Add empty po file for en-US language

* Update instructions for Docker

* Update default po file

* Convert locale readme to markdown and expand a bit the instructions

* Don't compile translations for 3rd party packages

* Use simplified settings & set env variables for compiling translations

* Update README for translations

* Improve metadata for Brazilian Portuguese translations

* Fix condition for django compressor on Heroku

* Fix condition for Django Compressor
2023-06-09 11:12:44 +01:00

27 lines
433 B
Bash

#!/usr/bin/env bash
{%- if cookiecutter.frontend_pipeline == "Django Compressor" %}
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
{%- endif %}
python manage.py collectstatic --noinput
python manage.py compilemessages -i site-packages